For Programmers: Free Programming Magazines  


Home > Archive > MSDN > June 2006 > Intercepting File Save As dialog box









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Intercepting File Save As dialog box
Burnsie

2006-06-17, 8:03 am

Can I intercept the file Save As dialog so that I can change the directory
and file name before saving? I am using VBA and have tried using the
filedialog(msoFileSaveAs) and have tried using the API that has been talked
about in other threads(this is done in the PresentationBeforeSave event--see
code). However, I haven't seen anything about intercepting the File Save As
dialog box.
Dim dlgSaveAs As FileDialog

Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)

With dlgSaveAs
If .Show = -1 Then
.InitialFileName = "\WEdge\Development\test.pps"
.Execute
'Cancel = True If I set this to true then I am brought back to the
presentation I was working on.
End If
End With

As for why I am trying to intercept, I have a dialog box I call in
powerpoint. Based on the inputs from the user, I then determine which
template is displayed. After they make changes to the template, I want to
suggest a file name and directory to save.

When I tried the filedialog(msoFileSaveAs) in the PresentationBeforeSave
event, it will display the File Save As dialog box but it doesn't actually
save it (yes, I do use the .Execute command after checking that .Show is
true). Furthermore, when I get through the PresentationBeforeEvent, another
File Save dialog box pops up that has the suggested name for the
activepresentation.

Any help would be much appreciated.

Thanks,

Burnsie
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com