Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alt File Open subdirectory change.

    The following macro opening utility works in Word 2000, but no longer in XP.
    In Word 2000 if the input letters aren

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Alt File Open subdirectory change.

    What if you change the document path separately?
    ...
    ' Attempts to use variable input in a VBA equation.
    Options.DefaultFilePath(wdDocumentsPath) = "C:PWWI"
    Documents.Open FileName:="FWI1" & VarFmInputbox, ConfirmConversions:= _
    False, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
    PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
    WritePasswordTemplate:="", Format:=wdOpenFormatAuto
    ...

    If you want to trap the error for the users, you could add:
    ...
    ' Attempts to use variable input in a VBA equation.
    Options.DefaultFilePath(wdDocumentsPath) = "C:PWWI"
    <font color=blue>On Error Resume Next</font color=blue>
    Documents.Open FileName:="FWI1" & VarFmInputbox, ConfirmConversions:= _
    False, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
    PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
    WritePasswordTemplate:="", Format:=wdOpenFormatAuto
    <font color=blue>If Err.Number = 5174 Then
    Err.Clear
    On Error GoTo 0
    Dialogs(wdDialogFileOpen).Show
    Else
    On Error GoTo 0
    End If</font color=blue>
    ...

  3. #3
    New Lounger
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Alt File Open subdirectory change.

    Wow, thanks! <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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