J
Jeremy
Looks like this:
Invoice # : {MACROBUTTON NoMacro [Click Here]}
How do I make this a "formfield" or something and create a macro that will
take the value that's entered by the user into the "Invoice" box (using
formula above) and automatically use the invoice number as the document name
when I run my save-as macro?
Somebody provided me this formula, but I'm just not to sure how to use it:
' jer2 Macro
' Macro created 5/26/2005 by Jeremy
'
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogFileSaveAs)
With oDlg
' you can get the name from a formfield by identifying it by name
' in this case you'll have to change "ProjectName" to the name of your
FormField
.Name = "C:\invoices\new invoices" &
ActiveDocument.FormFields("ProjectName").Range.Text
.Show
End With
End Sub
And for the record, my saveas macro looks like this:
Sub saveas()
'
' saveas Macro
' Macro created 2005 May 30 by Jeremy Shaw
'
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogFileSaveAs)
With oDlg
.Name = "c:\invoices\new invoices" ' the directory
.Show
End With
End Sub
Invoice # : {MACROBUTTON NoMacro [Click Here]}
How do I make this a "formfield" or something and create a macro that will
take the value that's entered by the user into the "Invoice" box (using
formula above) and automatically use the invoice number as the document name
when I run my save-as macro?
Somebody provided me this formula, but I'm just not to sure how to use it:
' jer2 Macro
' Macro created 5/26/2005 by Jeremy
'
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogFileSaveAs)
With oDlg
' you can get the name from a formfield by identifying it by name
' in this case you'll have to change "ProjectName" to the name of your
FormField
.Name = "C:\invoices\new invoices" &
ActiveDocument.FormFields("ProjectName").Range.Text
.Show
End With
End Sub
And for the record, my saveas macro looks like this:
Sub saveas()
'
' saveas Macro
' Macro created 2005 May 30 by Jeremy Shaw
'
Dim oDlg As Dialog
Set oDlg = Dialogs(wdDialogFileSaveAs)
With oDlg
.Name = "c:\invoices\new invoices" ' the directory
.Show
End With
End Sub