Word 2002 SP3 SaveAs FileDialog macro code problem

Posted on 2004-11-17
Last Modified: 2011-10-03
I got this from the VBA Help of Word 2002:
This example displays the Save As dialog box.

Sub ShowSaveAsDialog()
    Dim dlgSaveAs As FileDialog
    Set dlgSaveAs = Application.FileDialog( _
End Sub
 This creates two problems for me:
1) It displays the SAVE and NOT the SAVEAS dialog, anyone know why?
2) When I type in the filename to save the file as, the file is NOT saved as such, anyone know why?

Hope you can shed some light on this for me VBA is not my forte

Question by:CMYACHTIE
    LVL 76

    Accepted Solution

    I cannot compile your code in my Word 2000 application - FileDialog type is not known. For this reason, it may be better to have this question moved to the Word Area.
    Meanwhile, you might like to try this alternative code which works OK for me in Word 2000 VBA.

    Sub ShowSaveAsDialog()
        Dim dlgSaveAs As Dialog
        Set dlgSaveAs = Dialogs(wdDialogFileSaveAs)
    End Sub

    Author Comment

    Thanks GrahamSkan that works for me, funny how many different reactions one gets between 2000 and XP in VBA code.
    It's been very frustrating

    Thanks for you help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now