| 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
|