Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urgent - Can I detect the Cancel event of SaveAs? (Word 2002)

    Hi,

    I was just wondering whether it is possible to detect using VBA whether, when in the SaveAs dialog box, a user clicks on Cancel rather than Save. I need to set a blnSaved flag to false if the Cancel was selected and true if the Save was selected.

    Here is my code for SaveAs:

    Public Sub FileSaveAs()
    MsgBox "Saving..."
    Dim dlg As Dialog 'Create SaveAs dialog box
    Set dlg = Dialogs(wdDialogFileSaveAs)
    dlg.Display 'Display SaveAs dialog box
    End Sub

    Any feedback would be much appreciated <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Thanks,

    Chris

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Urgent - Can I detect the Cancel event of SaveAs? (Word 2002)

    Something like:

    if Dialogs(wdDialogFileSaveAs) = 0 then
    msgbox "Cancelled"
    else
    msgbox "Saving"
    end if
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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