Reply
 
Thread Tools Display Modes
  #1   Report Post  
Dbltap
 
Posts: n/a
Default How do I make this macro add text in front...

I was given this great macro to create the file name based off of a specific
field in a form but how would I modify it to add a set name in front of the
form info?

Here is the macro:

Dim fname as string
fname = ActiveDocument.Formfields("filenameformfieldname") .Result
ActiveDocument.SaveAs fname

Right now the field is a number i.e. 4856, and I would like it to have it
save as €œP&D Report 4856.doc€

What would I add?

Thanks, this forum is great!

Chris

  #2   Report Post  
Greg
 
Posts: n/a
Default

Chris,

Something like:

Dim fname As String
Dim fVar As String

fVar = ActiveDocument.FormFields("filenameformfield").Res ult
fname = "Whatever you like " & fVar
ActiveDocument.SaveAs fname

  #3   Report Post  
Dbltap
 
Posts: n/a
Default

Thanks Greg! Just what I needed. One of these day's I'll get the hang of it
but right now macros's are all french to me

"Greg" wrote:

Chris,

Something like:

Dim fname As String
Dim fVar As String

fVar = ActiveDocument.FormFields("filenameformfield").Res ult
fname = "Whatever you like " & fVar
ActiveDocument.SaveAs fname


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do a make a doc save based on a text field? Dbltap Page Layout 5 March 2nd 05 12:44 AM
How to use make a macro active new office 2003 user Microsoft Word Help 2 January 21st 05 02:31 AM
How can I make the text that Iam printing larger ? mepoppy Page Layout 1 January 17th 05 04:16 AM
How do you make text wrap in a paragraph? cat 345 Microsoft Word Help 1 January 12th 05 04:22 PM
Outline Renee Hendershott Page Layout 2 December 25th 04 02:49 PM


All times are GMT +1. The time now is 02:36 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"