ActiveDocument.save

G

Graham Scott

Hi,

This ought to be simple (surely!) but it is giving me grief. Any suggestions
gratefully received!

At the end of Sub Document_New, I try to save the ActiveDocument, like this:

ActiveDocument.Save

The document has not been saved before, so this invokes the Save As dialog.
This is exactly what I want, because I want the user to be able to select
the save location. However, I would like to be able to pre-fill the dialog's
File Name field with a suggested file name, and I can't seem to figure out
how to do it! I have set the built-in Title property, and the ActiveWindow
Caption, but the dialog obviously isn't filling the File Name field from
either of these. What else should I try??

Second problem is that when I press the Cancel button on the Save As dialog,
to abort the save, I get Runtime error '4198' on the ActiveDocument.Save
call. What's that all about??

Thanks in advance for any help!

GRS
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

The following code will display the FileSaveAs dialog with the name of the
file to be save preset to "test"

With Dialogs(wdDialogFileSaveAs)
.Name = "Test"
.Show
End With


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

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