View Single Post
  #7   Report Post  
Posted to microsoft.public.word.pagelayout
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Link the File name to a bookmark when saving the file

Looking at the OP's macro comment "Saves a copy of the document in a
separate file" I suspect the requirement might be to save a second copy in
another folder. That can be done from the first macro simply by adding the
required paths. There are some examples at
http://www.gmayor.com/automatically_backup.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Doug Robbins - Word MVP wrote:
You want both macros to do the same thing. Therefore, use exactly
the same code in both of them - FileSave() and FileSaveAs

With ActiveDocument
.SaveAs .FormFields("formfieldbookmarkname").Result
End With


"bsieloff" wrote in message
...
Ahh.. Macro. Very cool, it works!

One more question... I tried to setup the "SaveAs" fuction as well
and did not find the correct syntax, can you look at this and
correct my mistake? Thanks again

Sub FileSave()
'
' FileSave Macro
' Saves the active document or template
'
With ActiveDocument
.SaveAs .FormFields("Company_Name").Result
End With


End Sub
Sub FileSaveAs()
'
' FileSaveAs Macro
' Saves a copy of the document in a separate file
'
With ActiveDocument
Dialogs .SaveAs.FormFields("Company_Name").Result
End With



End Sub




"Doug Robbins - Word MVP" wrote:

It needs to be located in the template from which you are creating
the document.

See the article "What do I do with macros sent to me by other
newsgroup readers to help me out?" at:

http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of
my services on a paid consulting basis.

Doug Robbins - Word MVP

"bsieloff" wrote in message
...
Looks like this will do it.... but I'm not sure where this
statement needs
to
be placed. anywhere on the document? How do I get in the "mode"
to enter
the statement, IE. Insert field?

Thanks for you help, and baby stepping me through

-B

"Doug Robbins - Word MVP" wrote:

Use the .Result property of the formfield to get the information
that has
been entered into it

With ActiveDocument
.SaveAs .FormFields("formfieldbookmarkname").Result
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself
of my services on a paid consulting basis.

Doug Robbins - Word MVP

"bsieloff" wrote in message
...
I would like to have the file save as one of my bookmarks when I
save the
file for the first time. Usually the default is the first
several words
at
the beginning of the document, but I would like to have it
default to
one
of
the form fields I have the users type in. Is that possible?

Thanks
-B