HeaderLeft property
Contains the text string that appears in the left portion of a document's header.
Version added
2002
Syntax
| |
| |
strRet |
String. The text in the left portion of the header. |
object |
Required. An expression that returns a Document object. |
stringExpression |
Required String. New text for the left portion of the header. |
Remarks
You can also set this value in the Left box under Header in the Header and Footer dialog box (on the View menu, click Header and Footer).
Both strRet and strExpression can contain escape codes that represent data. These escape codes can be concatenated with other text. For a list of valid escape codes you can use with the HeaderLeft property, see the FooterLeft property
Example
The following macro is used to place a string containing the current date into the left portion of a document's header.
Sub SetHeaderLeft()
Dim szHeader as String
'Build header string
szHeader = "The Date is " & "&D"
'Set header of current document
ThisDocument.HeaderLeft = szHeader
End Sub
If the date was May 4, 2002, the left portion of the header contains "The Date is Thursday, May 4, 2002" after running this macro.