View Single Post
 
Old 02-25-2012, 09:52 AM
sinbad sinbad is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Feb 2012
Posts: 2
sinbad is on a distinguished road
Default Coding into a macro a carriage return

I can't find a way to put two lines into a header via a macro. I want to say, Put this text in the header .... 'header text header text'
And put these full points underneath '..................................'
So it's a two-line header.

My macro doesn't work this way ....
Quote:
Sub HeaderFooterObjectBest_English()
Dim MyText As String
MyHeaderText = "..........................."
MyHeaderText = "Paul | new words for the week | Best-English.org | 1 of 1"
MyFooterText = "Best-English dot org"
Selection.Font.Name = "Courier New"
Selection.Font.Size = 9
With ActiveDocument.Sections(1)
.Headers(wdHeaderFooterPrimary).Range.Text = MyHeaderText
.Footers(wdHeaderFooterPrimary).Range.Text = MyFooterText
End With
End Sub
Be very grateful for guidance.
Reply With Quote