SaveAs Filename

L

lynn

This is a repost...

Have macrocode for serializing a document... which
includes the following code:
ActiveDocument.SaveAs FileName:="RegNo" & Format
(RegNo, "00000#")
which automatically names the document and saves it (which
is part of the requirement)to the current (or last opened)
folder. The FileName argument can only include the "file
name" or the "complete path".

The question: how can I write the code to get the "named"
and "saved as" file to save to a generic folder off
the "C" drive or a folder out on the the network?

Example please? (am example challenged...) Thanks and
best regards
 
A

Astrid

Hi Lynn,
Have macrocode for serializing a document... which
includes the following code:
ActiveDocument.SaveAs FileName:="RegNo" & Format
(RegNo, "00000#")
which automatically names the document and saves it (which
is part of the requirement)to the current (or last opened)
folder. The FileName argument can only include the "file
name" or the "complete path".

The question: how can I write the code to get the "named"
and "saved as" file to save to a generic folder off
the "C" drive or a folder out on the the network?

Combine path and filename, for example:
-----------------------------------------------------------------------
Dim sNetWorkPath As String
Dim sLocalPath As String
Dim sFileName As String

sNetWorkPath = "M:\"
sLocalPath = "C:\My Documents"
sFileName = "Filename here"

ActiveDocument.SaveAs FileName:=sNetWorkPath & sFileName
ActiveDocument.SaveAs FileName:=sLocalPath & sFileName
-----------------------------------------------------------------------

Hope this helps,
regards,
Astrid

So that all can benefit from the discussion, please post all follow-ups to the newsgroup.
Visit the MVP Word FAQ site at http://www.mvps.org/word/
 

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