Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Page Layout / March 2005

Tip: Looking for answers? Try searching our database.

How do a make a doc save based on a text field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dbltap - 23 Feb 2005 07:05 GMT
Is there a way to make a form base the save as name on the text in a specific
text box? I couldn't find this by searching.

Thanks.
Doug Robbins - 23 Feb 2005 10:47 GMT
Dim fname as string
fname = ActiveDocument.Formfields("filenameformfieldname").Result
ActiveDocument.SaveAs fname

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Is there a way to make a form base the save as name on the text in a
> specific
> text box? I couldn't find this by searching.
>
> Thanks.
Dbltap - 23 Feb 2005 15:51 GMT
Ok, I think this is what I need. I followed instructions on the MVP site on
what to do with macros others sent and I created the macro in the template I
want this to work in. I then went into the text box properties for that field
and selected the macro I created to run on exit of that box and checked
calculate on exit but it still doesn't work.

The save name it always gives me is my old home address and I can not figure
out where it is getting this from. Is there a macro running that I don't know
about or am I missing something really basic? If you can't tell I'm new to
macros.

Thanks again.

> Dim fname as string
> fname = ActiveDocument.Formfields("filenameformfieldname").Result
[quoted text clipped - 5 lines]
> >
> > Thanks.
Doug Robbins - 24 Feb 2005 00:23 GMT
I assume that you replace "filenameformfieldname" with the actual name of
the bookmark assigned to the formfield?

If you run a macro containing the following code on exit from the formfield,
what is displayed in the message box:

MsgBox ActiveDocument.Formfields("filenameformfieldname").Result

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Ok, I think this is what I need. I followed instructions on the MVP site
> on
[quoted text clipped - 23 lines]
>> >
>> > Thanks.
Dbltap - 01 Mar 2005 06:27 GMT
Ok I figured out my mistake, thanks Doug. Now if I wanted it to have
something added in front of the text from the named field, i.e. "P&D Report"
and then the field name how would I do that?

Thanks again for putting up with my dumb questions.

Chris

> I assume that you replace "filenameformfieldname" with the actual name of
> the bookmark assigned to the formfield?
[quoted text clipped - 31 lines]
> >> >
> >> > Thanks.
Doug Robbins - 02 Mar 2005 00:44 GMT
Replace

fname = ActiveDocument.Formfields("filenameformfieldname").Result

with

fname = "P&D Report" &
ActiveDocument.Formfields("filenameformfieldname").Result

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Ok I figured out my mistake, thanks Doug. Now if I wanted it to have
> something added in front of the text from the named field, i.e. "P&D
[quoted text clipped - 45 lines]
>> >> >
>> >> > Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.