Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
file naming
I've set up a template with a couple of parameters that are entered using
FILLIN when a new doc is created from the template. Is there some way of using these parameters to set the file name when the new doc is saved for the first time? Never used VBA .. but all advice welcomed! Thanks in advance Dick V |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
file naming
Hi ?B?RGlja1Y=?=,
I've set up a template with a couple of parameters that are entered using FILLIN when a new doc is created from the template. Is there some way of using these parameters to set the file name when the new doc is saved for the first time? Never used VBA .. but all advice welcomed! It would certainly require VBA. You'd need to select each of the Fillin fields and assign them bookmarks. Then the macro can pick up the content fairly easily. Example: Sub FileSaveAs Dim fileName as String Dim doc as Word.Document Set doc = ActiveDocument fileName = doc.Bookmarks("FirstPart").Range.Text _ & doc.Bookmarks("SecondPart").Range.Text & ".doc" doc.SaveAs fileName End Sub Where "FirstPart" and "SecondPart" represent bookmark names assigned in Insert/Bookmark Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
merge instructions from text file | Mailmerge | |||
File naming specifications / Invalid file name | Microsoft Word Help | |||
How do I prevent Word from locking the file? | New Users | |||
open file | Microsoft Word Help | |||
File Corruption problems | Page Layout |