Group: microsoft.public.word.vba.general
From: =?Utf-8?B?RGV2YWxpbGFKb2hu?=
Date: Sunday, March 23, 2008 3:44 PM
Subject: Re: Populating data into headers or footers

Doug,

That's spot on, thanks for the help.

"Doug Robbins - Word MVP" wrote:

> Instead of using bookmarks, have the code in your user form set the values
> of document variables
>
> With ActiveDocument
> .Variables("varname1").Value = somecontrolname1.Value
> .Variables("varname2").Value = somecontrolname2.Value
> 'etc
> .PrintPreview
> .ClosePrintPreview
> End With
>
> then in the document, insert DOCVARIABLE fields at the locations that you
> want the data to appear.
>
> The PrintPreview/ClosePrintPreview is the lazy man's way of getting all of
> the fields in the document to update so that each DOCVARIABLE field shows
> the value that has been assigned to the associated variable.
>
> --
> 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
>
> "DevalilaJohn" wrote in message
> news:22635A72-C46C-434D-B571-E51433AED94F@microsoft.com...
> >I have a macro that takes data from a user form, as part of a letterhead
> >and
> > populates the date, addressee, etc. into the letter. I do this via
> > bookmarks
> > in the document. I also want to populate some of the data into the footer
> > on
> > the second page.
> >
> > Any suggestions on how to do it would be greatly appreciated.
> >
> > TIA,
> >
> > John
>
>
>

Safety Articles | Usenet Groups | Usenet News | Bluegrass