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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dbltap (Dbltap_at_discussions.microsoft.com)
Date: 03/01/05


Date: Mon, 28 Feb 2005 22:27:03 -0800

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

"Doug Robbins" wrote:

> 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
>
>
> --
> 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
> "Dbltap" <Dbltap@discussions.microsoft.com> wrote in message
> news:AAFF7C13-6E9F-406A-8FAD-CEA02DC3B2BF@microsoft.com...
> > 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.
> >
> >
> > "Doug Robbins" wrote:
> >
> >> Dim fname as string
> >> fname = ActiveDocument.Formfields("filenameformfieldname").Result
> >> ActiveDocument.SaveAs fname
> >>
> >> --
> >> 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
> >> "Dbltap" <Dbltap@discussions.microsoft.com> wrote in message
> >> news:EDF684B9-52A5-4BDD-B0ED-62E2FEDDDFD9@microsoft.com...
> >> > 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.
> >>
> >>
> >>
>
>
>



Relevant Pages

  • Re: Field in form problem Word 2003
    ... Thank you Doug, had not thought of looking further up the form. ... Doug Robbins - Word MVP ... Run a macro on entry and run a macro on exit are both blank. ...
    (microsoft.public.word.newusers)
  • Re: Saved Mailmerge documents - Updating themselves
    ... Word MVP web site http://word.mvps.org ... I'll try and follow your macro ... > "Doug Robbins" wrote: ... you must first execute the mailmerge to a new ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word 2007 Find Problem
    ... Yes - that works as well Doug ... I have tried the vbCr trick in the macro and that works and has fixed the ... Doug Robbins - Word MVP ...
    (microsoft.public.word.vba.general)
  • Re: Word 2007 Find Problem
    ... microsoft.public.word.drawing.graphics newsgroup. ... Doug Robbins - Word MVP ... I have tried the vbCr trick in the macro and that works and has fixed the ...
    (microsoft.public.word.vba.general)
  • Re: Can I link form fields within a Word document?
    ... Calculate on exit will only work if the REF fields are in the body of the ... Otherwise you would have to use a macro to run on exit from the ... Word MVP web site http://word.mvps.org ...
    (microsoft.public.word.docmanagement)