Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word - is there a Date Add function???

Status
Not open for further replies.

GaryRW

Programmer
Mar 8, 2002
67
GB
I am trying to do something which I think is really simple but I can not figure it out.

I am setting out a timetable type document which sets out a lists of dates for things to happen, i.e. next week, four weeks time, 10 weeks time. Effectively what I want to say is {(Date + 28) \@ "d MMMM yyyy" } but as I am sure you have guessed - that doesn't work. In VBA I use DateAdd ("d", 28, Date) but is there a way to do this in word mergefields???

Your help will be much appreciated.
 
Hi Indu,

I had a look and it certainly gives me something to think about! At least I wasn't missing something obvious....

However, the (very long) field code referred to only works for upto one month in advance - I'm looking at dates a year in advance and I think the method above would just be unworkable.

I am loading the word file from within Access via VBA. Could I set bookmarks in the word doc, and then run a piece of VBA in word to update those bookmarks once the file is loaded? (working out the future dates would be simple in VBA)



 
Hi, Gary!

At the bottom of the link I pointed out there is some VBA code. I haven't looked as to how useful it may be to you, but it does use adding or subtracting a number of days you wish.

Indu
 
oops

Had I scrolled down, it shows exactly (!) what I have suggested above and how to do it.

Thanks for the helpful pointer (even if I'm too dum to see the full extent without being spoon fed)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top