Instead of a table, I used the code you provided but then I cleared and then reset the TabStops which allowed me to control the position of the text with the level of control that I needed.ĭim footer As Word.Range = doc.Sections(1).Footers().Rangeĭoc.Sections(1).PageSetup.DifferentFirstPageHeaderFooter = Trueį(footer,, "AUTOTEXT ""Page X of Y"" ", True)įooter.Collapse()įooter.InsertBefore( "Section 4" & vbTab & "Technical Data" & vbTab)į()į(wdApp.InchesToPoints(4.5), )į(wdApp.InchesToPoints(9), )į = 50 I was finally able to get the effect I needed. Rng.InsertBefore(vbTab & "Centered text" & vbTab & "Page") Of course, you probably want to use field codes for the numbers, which makes things a bit more complicated.There are a number of different approaches for coding it here's a code snippet to give you the general idea of one of those:ĭim Word.Range rng = doc.Sections(1).Headers().Range If your text were static, you'd just drop it in like this: rngFooter.Text = "Section 4" & Chr(9) & "Technical data" & Chr(9) & " of 3" The paragraph contains two tab stops: centered and right, with center and right alignment. This is the more traditional approach and is supported by Word's built-in Header and Footer styles. For example, in some versions of Word things don't work correctly if there's also a graphic (Shape) anchored in the header/footer, such as a Watermark.Ģ. There are known issues under some circumstances, however, where a table in the header/footer causes problems. All things being equal, many prefer this approach because longer text will be restricted to its own column and will break to a new line in that column. Set the Paragraph Alignment for each column (cell) to Left, Center and Right, respectively. Insert a three-column table into the footer range. There are two basic approaches to achieve the alignment you describe:ġ. You address this footer with the wdHeaderFooterPrimary enum. In order to specify second page and following for the footer, you need to activate the Different First Page option (for the section or for the document).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |