Newbie macro help please

  • Thread starter Thread starter Barnet
  • Start date Start date
Doug wrote:

Use:

Dim prange As Range
With ActiveDocument
Set prange = .Sections(1).Footers(wdHeaderFooterPrimary).Range
..Fields.Add Range:=prange, Type:=wdFieldEmpty, Text:="page"
prange.ParagraphFormat.Alignment = wdAlignParagraphCenter
End With

If you want the page number on the right, replace wdAlignParagraphCenter
with wdAlignParagraphRight, similarly for left.

--
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

Thanks so much Doug, I appreciate your efforts. Being completely unfamiliar
with Visual Basic, I need some more assistance in knowing what to do with
this code.

I can find the box to edit Macros. However, simply pasting in the code
doesn't seem to make anything happen when I then try to run the Macro

Would you be kind enough to tell me what to do with your code so that I can
make the macro work?

I assume that this post is to the newsgroup, so I hope it's OK that I ask
you here.

Thanks,

Barnet
 
Ooops, sorry for the double post. I actually didn't see the Next page tab at
the bottom and so I thought the first one didn't go through.

Barnet
 
Yes, this is the place to ask for assistance.

See the following articles:

"What do I do with macros sent to me by other newsgroup readers to help me
out?" at:

http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

"How to assign a Word command or macro to a hot-key" at:

http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm

"How to assign a Word command or macro to a toolbar or menu" at:

http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm




--
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
 
Hi Doug,

Thanks so much, this did the trick! I really appreciate your efforts on my
behalf.

Barnet
 
Back
Top