How do you center the text in the footer from vb6

  • Thread starter Mustapha Amrani
  • Start date
M

Mustapha Amrani

How do you center the text in the footer.

wrdSelection.Sections(1).Footers(wdHeaderFooterPrimary).Range.Font.Size = 8
wrdSelection.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "Some
text for footer"

Thanks

M
 
D

Doug Robbins - Word MVP

Hi Mustapha,

As there is by default a centre aligned tab in the footer, you can just use:

ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Font.Size =
8
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = vbTab
& "Some text for footer"

Alternatively,

ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Font.Size =
8
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Text = "Some
text for footer"
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.ParagraphFor
mat.Alignment = wdAlignParagraphCenter

will align the text without the use of the tab.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top