msoFileDialogSaveAs

S

Senad Isanovic

I want to allow the user to save the document as soon as the new document is
created. I load the SaveAs dialog box (AutoNew),

Sub AutoNew()

Application.FileDialog(msoFileDialogSaveAs).InitialFileName =
Options.DefaultFilePath(wdDocumentsPath)
Application.FileDialog(msoFileDialogSaveAs).Show

End Sub

But when the user enters the name of the file and then press Save buttot the
active document is still called "Document1" and not the name that the user
entered. I don't want to use ActiveDocument.Save and save the doc from the
code. I want to allow user to save the doc and choose the path ant the
filename.
 
H

Helmut Weber

Hi Senad,
first I don't understand why you are trying to use an office dialog
"msodialog..." instead of a word dialog "wddialog...".
Then I guess (!), something like FileDialog(msoFileDialogSaveAs) would
address a very new dialog, everytime it is called. Means
Application.FileDialog(msoFileDialogSaveAs).InitialFileName = _
Options.DefaultFilePath(wdDocumentsPath) is not the same dialog as
Application.FileDialog(msoFileDialogSaveAs).Show
This is working here and now:
Sub AutoNew()
Dim oDlg As Dialog ' Object Dialog
Dim sPth As String ' String Path
sPth = Options.DefaultFilePath(wdDocumentsPath) & "\"
Set oDlg = Dialogs(wdDialogFileSaveAs)
oDlg.Name = sPth & "test.doc"
oDlg.Show
End Sub
'---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top