SaveAs Filename method

L

lynn

Have macrocode:
ActiveDocument.SaveAs FileName:="RegNo" & Format
(RegNo, "00000#)

which is part of a macro that advances the serial number
by 1, and automatically names and saves the document to
the "current" open folder (or last folder opened). How can
I run the macro to do the same, except direct the file to
a directory on the network? The FileName argument can
only include the file name or the complete path - can
these be combined and how (please show example). My
thanks and Best regards...
 
E

Ed

Hi, Lynn.

In my macro, I have before the Sub starts the following:
Const SavePath = "C:\Documents and Settings\username\Desktop\targetfolder\"

Then the following code in the sub:
Dim SourceDoc As Document, PathDoc As Document

Set SourceDoc = ActiveDocument
Set PathDoc = Documents.Add
PathDoc.SaveAs FileName:=SavePath & "File Paths.doc"

This creates a new document, names it "File Paths.doc", and saves it to the
path named SavePath.

Hope this helps.
Ed
 

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