View Single Post
 
Old 10-18-2013, 06:47 AM
BoringDavid BoringDavid is offline Windows XP Office 2010 32bit
Novice
 
Join Date: Sep 2013
Posts: 19
BoringDavid is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You have
Dim AgeofPlan As Date
but you're passing 'DateDiff(yyyy, TheDate, Now)' to it, which is a number, not a date.

To insert the content into the document, bookmark the destination, then use code like the attached.
The code in that attachment has gone straight over my head!

The destination is already bookmarked as 'Years1', I have no need for days or months being added, just the year (with no additional content), which will be inserted into the bookmark 'Years1' that is already in a sentence in the document, however, this is all dependent upon a series of logic arguments. Therefore, I need the age to be set as an expression in the same manner that I set the start date (b = Format(Me.DTPStartDate.Value, "d MMMM yyyy"), although in this case I want it to be "c").
Reply With Quote