Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste a filename in Word

Status
Not open for further replies.

koresnordic

IS-IT--Management
Nov 28, 2002
422
GB
Is is possible for me to pick up some text in Word (same location EVERY time) and use this as the filename in a "saveas" command?

[pc]

Graham
 
Sure, yes, absolutely. Simple really. Have you tried using the macro recorder?

I suggest, since you state it is the same location EVERY time, that you make that location a Bookmark. Then simply pick up the Bookmark text and insert that into the SaveAs command.

Gerry
 
Gerry,
Thx for the reply. But the document is generated "On the fly" from another document and therefore cannot really bookmark a part of it. Unless there is a way of doing this inside a script? Then how would I pick up the value of the bookmark inside the script? at the moment I have:

nam = "c:\temp\KNGB Remittance " & i
ActiveDocument.SaveAs FileName:=nam

Where "i" is a variable. If I could make "i" equal the text in the second row of the document, then this would be perfect.


[pc]

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top