Re: How do I create a button in a word template that will run a ma by Lobo
Lobo
Wed Feb 02 16:01:07 CST 2005
Jezebel,
Thanks for the help, I'm just new to all this Macro writing, therefore my
bad macro.
I did not want the Button on the tool bar but in the document , so that it
is only available when that Template gets opened.
I have put in a command button object , that works
Now I need to be able to print each page seperately , and if possible with
the file name as one of the fields that was input previously
thanks
"Jezebel" wrote:
> Right-click any toolbar. Select customize. On the Commands tab select Macros
> in the Categories list. Select your macro from the Commands list and drag it
> to the toolbar yuou want.
>
> Separately, that's a pretty lousy way to update the fields. You could just
> use this line in place of what you currently have --
>
> ActiveDocument.Fields.Update
>
> But are you aware that your code (and this one-line equivalent) updates
> fields only in the body of the document, not in headers, footers, textboxes,
> etc? If you want to update all fields, wherever they are, use --
>
> Dim pRange as Word.Range
>
> For each pRange in ActiveDocument.StoryRanges
> Do
> pRange.Fields.Updatge
> Set pRange = pRange.Next
> Loop until pRange is nothing
> Next
>
>
>
>
>
>
>
> "Lobo" <Lobo@discussions.microsoft.com> wrote in message
> news:B143DE2C-3FC0-4733-AC9F-9EB404D404ED@microsoft.com...
> >I Have four fields that need to be updated when the template is opened and
> >I
> > have recorded a macro
> > Selection.WholeStory
> > Selection.Fields.Update
> > Selection.HomeKey
> >
> > Now I want to display a button that the user can click to run this macro
> > so
> > he can update the fields.
> >
> > is it also possible to print the pages individualy to individual pdf
> > files
> > via a macro to be attached to an email later?
> >
> > Thanks
>
>
>