macros in forms

  • Thread starter Thread starter Stormy Weather
  • Start date Start date
S

Stormy Weather

I want to make a macro that will save a template using the information filled
in on one of the entries as the file name. I cannot make the macro pick up
the blank field in the template / form. Any ideas?
 
If you are using FormFields, you can get the data that is entered into a
FormField by using

ActiveDocument.FormFields("bookmarkname:).Result

--
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
 
It is helpful, but I'm still not sure how to apply it. It opened up the
world of writing macros to me, though!
Here is how the macro looks with your suggestion:

Sub SaveAsDrawingNumber()
'
' SaveAsDrawingNumber Macro
'
'
ChangeFileOpenDirectory _
"E:\ELJD\Pending\"
ActiveDocument.SaveAs FileName:= _
"E:\ELJD\Pending\ActiveDocument.FormFields.Text13.Result.doc", _
FileFormat:=wdFormatDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="",
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False,
SaveFormsData _
:=False, SaveAsAOCELetter:=False
End Sub

Of course it saves it to the right place, but the file name is always
ActiveDocument.FormFields.Text13.Result.doc

Can you provide further assistance? By the way, the properties describes
the field I would like to use as the document title as a "bookmark."
 
Change

ActiveDocument.SaveAs FileName:= _
"E:\ELJD\Pending\ActiveDocument.FormFields.Text13.Result.doc",

To

ActiveDocument.SaveAs FileName:= _
"E:\ELJD\Pending\" & ActiveDocument.FormFields.Text13.Result &
".doc",

--
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
 
Back
Top