Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Fancy header/footer alignments, please help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 23 Nov 2005 19:50 GMT
Hi! I need to create Header and Footer programmatically in my Word 2003
document using C# or VBA.

The header should be like this:

On the Left side (left alligned) it should have a "DOCUMENT CATEGORY"
(passed as a parameter)
On the Right side (right alligned) it should have a "SPELLED OUT DATE"
(Monday November 21,2005) (passed as a parameter)

The footer should be like this:

On the Left side it should have a "CONFIDENTIAL"(passed as a parameter)
On the Right side (right alligned) it should have a "PAGE #" (passed as a
parameter)

So far I got this:
doc.Sections[1].Headers    [Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text = "3 MONTHS REPORT";
This line creates a left-alligned entry in the header. But how can I insert
the date that's right-alligned ?

Thank you in advance,

--Michael
Jezebel - 24 Nov 2005 09:44 GMT
The easy way to do this is to pre-format the footer in your template using
DocProperty fields for the parameters you will be passing. (Insert dummy
values in the template, so you can get the formatting as you want it.) Then
from your code, set the document properties and update fields in the footer.

> Hi! I need to create Header and Footer programmatically in my Word 2003
> document using C# or VBA.
[quoted text clipped - 23 lines]
>
> --Michael

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.