Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   How do I get a very long file path to wrap in a footer (MS Word 20 (http://www.outlookbanter.com/outlook-vba/84481-how-do-i-get-very.html)

Sierk January 13th 09 09:26 PM

How do I get a very long file path to wrap in a footer (MS Word 20
 
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
--
Sierk

Ken Slovak - [MVP - Outlook] January 14th 09 03:33 PM

How do I get a very long file path to wrap in a footer (MS Word 20
 
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Sierk" wrote in message
...
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
--
Sierk



Sierk January 16th 09 07:36 PM

How do I get a very long file path to wrap in a footer (MS Word 20
 
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.
--
Sierk


"Sierk" wrote:

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
--
Sierk



All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com