Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Macro not working (MSO2003/winxppro)

    Sometime ago I wrote the attached macro to open a folder containing various templates and attached it to a toolbar that only opens for specific users. Suddenly the macro will not open into the templates folder but opens My Documents.

    The file locations are as shown in attached.


    Can anyone tell me from the code what might be happening.

    Sub NewUsingFileOpenDialog()
    Const strPath As String = "cocuments and SettingsAll Users" & _
    "TemplatesIANZ Templates"
    ChangeFileOpenDirectory strPath
    With Dialogs(wdDialogFileOpen)
    If .Display = -1 Then
    Documents.Add Template:=.Name
    End If
    End With
    End Sub
    cheers

    Phil Carter

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro not working (MSO2003/winxppro)

    Instead of using ChangeFileOpenDirectory, try

    With Dialogs(wdDialogFileOpen)
    .Name = strPath
    If .Display = -1 Then
    ...
    ...

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    543
    Thanks
    56
    Thanked 0 Times in 0 Posts

    Re: Macro not working (MSO2003/winxppro)

    Hans thanks for that

    Worked just fine. It was driving me bananas.

    Phil
    cheers

    Phil Carter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •