Results 1 to 5 of 5

Thread: VBA: Show save dialog, with the current directory set to A:

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    VBA: Show save dialog, with the current directory set to A:

    how can i show the save dialog, with the current directory set to A: in microsoft word?.

    This is an important task i need to complete for my Unit 4 coursework, but if this isnt possible, i guess i will just get the filename from the "inputbox" function, but i would prefer to allow people to use the word dialog etc....

    if anyone can help, i wud b vry appriciative.
    Wayne

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    are you automating Word from VB? or are you using the VBA built into Word?

  3. #3

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    the vba editor in word, i need to add a save to a: function to a toolbar.
    Wayne

  4. #4

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065
    VB Code:
    1. Option Explicit
    2.  
    3. Sub SaveToA()
    4. '
    5. ' SaveToA Macro
    6. ' Macro created 03/05/2004 by Wayne Pearsall
    7. '
    8.     With ActiveDocument
    9.                 ' if the current document is not saved
    10.                 'If .Saved = False Then
    11.             ' Change the current system directory to the A: drive
    12.             ChangeFileOpenDirectory "A:\"
    13.             ' Call the application to display the "Save As" dialog
    14.             ' (which should be set at the A: directory)
    15.             .SaveAs
    16.                 'Else
    17.                 '    MsgBox "The current document is already saved!", vbInformation, "Document Saved!"
    18.                 'End If
    19.     End With
    20. End Sub

    I have got this code, but for some reason, it doesnt appear to show the save as dialog box, is there something wrong with it,,,?

    This is a real important task for my coursework, and is due in tomorrow afternoon, i have worked ma ass of for ages trying to figure it, but :@,,,

    Thanks,,,
    Wayne
    Wayne

  5. #5
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    Would probably get a faster response if you use the VBA Forums

    http://vbforums.com/forumdisplay.php?s=&forumid=37

Posting Permissions

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



Click Here to Expand Forum to Full Width