How do I get a very long file path to wrap in a footer (MS Word 20

  • Thread starter Thread starter Sierk
  • Start date Start date
S

Sierk

I have some customization that inserts a file path into the footer of a
document. The text however runs off the page when the string (file path) is
too long. Is there a way to automatically force the footer to wrap the text?

Thanks
 
Footer where? Is this an Outlook item of some type? What version of Outlook?

If this is purely a Word question then please post it in a Word group. This
is an Outlook group.
 
So I stumbled upon the answer though I have no idea what it does or where it
came from. The line of code that made it al work was:
WordBasic.ViewFooterOnly. The code that inserts the text in the footer is as
follows:

'WordBasic.ViewFooterOnly causes the string to be
'inserted properly with automatic line wrapping.
WordBasic.ViewFooterOnly

'Insert actual file path string.
Selection.TypeText Text:=sFileText
'Add filename field
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"FILENAME ", PreserveFormatting:=True

It does use a selection created in earlier code and inserts a file path
string "sFileText" that is defined in another sub.
 
Back
Top