Adding VBA to a MS Word 2000 Header -- How To 
Author Message
 Adding VBA to a MS Word 2000 Header -- How To

I would like to include a data range in my MS Word 2000 Header such
as:
< < <  Period: May 1, 2003 thru May 7, 2003 > > >

So that that period would show regardless of what day within the
period I ran the report

This is done on an MS Access form as follows:

Using unbound text-boxes on the MS Access form, add the following code
to the two Text-boxes:
StartDate = Date()-Choose(Weekday(Date()),11,12,13,7,8,9,10)
EndDate = Date()-Choose(Weekday(Date()),5,6,7,1,2,3,4)

And the form text would be something like:
FrmText = "Period: "&StartDate&" Thru "&EndDate

How can I add this to a Microsoft Word 2000 Header?

Any help greatly appreciated.

Thanks,

Robbie Bollinger



Mon, 24 Oct 2005 21:31:51 GMT  
 Adding VBA to a MS Word 2000 Header -- How To
Hi Robbie,

You can create two custom document properties (StartDate and EndDate), which
you can add and modify programmatically. Then, in your header, you can use
fields to display the correct dates.

<<< Period: { DOCPROPERTY StartDate } thru { DOCPROPERTY EndDate } >>>

HTH


Quote:
> I would like to include a data range in my MS Word 2000 Header such
> as:
> < < <  Period: May 1, 2003 thru May 7, 2003 > > >

> So that that period would show regardless of what day within the
> period I ran the report

> This is done on an MS Access form as follows:

> Using unbound text-boxes on the MS Access form, add the following code
> to the two Text-boxes:
> StartDate = Date()-Choose(Weekday(Date()),11,12,13,7,8,9,10)
> EndDate = Date()-Choose(Weekday(Date()),5,6,7,1,2,3,4)

> And the form text would be something like:
> FrmText = "Period: "&StartDate&" Thru "&EndDate

> How can I add this to a Microsoft Word 2000 Header?

> Any help greatly appreciated.

> Thanks,

> Robbie Bollinger



Mon, 24 Oct 2005 21:42:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adding code to a MS Word 2000 Header

2. MS PJ 2000 and MS Word via VBA

3. VBA code to add tab to Word 2000

4. Differences on word 2002 and word 2000 vba

5. vba problem word 97 and not word 2000

6. Differences between VBA for Word 2000 and Word 97

7. Does Word VBA 2002 developed code run on Word 2000

8. Word 97 and Word 2000 VBA - Functionality Lost?

9. Outlook 2000 Addin - How to add the header and footer for a print copy

10. Automatic Headers - Word 2000

11. Adjusting headers/footers in a macro in Word 2000

12. Executing MS SQL Server 2000 stored procs via MS Access 2000

 

 
Powered by phpBB® Forum Software