Enter and formatting text in header in word document

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChristineS
    New Member
    • Feb 2012
    • 1

    Enter and formatting text in header in word document

    Hi,

    I have a document where I want to create a macro that updates title, date and name in the header every week but that keeps the format of the text from the previous week. The format is different in the different rows, fx.

    Prognosis week 9 (Size 20)
    2012-02-29 (Size 18)
    John Doe (Size 10)

    So far I have this code but while it keeps the original font and colour, it changes the size of the text to the same in all three rows.

    [DocWord.Section s(1).Headers(wd HeaderFooterFir stPage).Range.T ext = "PROGNOSIS V." & VECKONUMMER(Dat e) & "" & vbLf & (Date) & vbLf & "John Doe"]

    I also want to put the date centered in the headers on all the following pages. I have this code but want it centered and with the right format.

    [DocWord.Section s(1).Headers(wd HeaderFooterEve nPages).Range.T ext = (Date)]

    Can someone help me with this?

    Thanks!
Working...