#1
|
||||
|
||||
Working with Dates in Word VBA
How to work with dates in word VBA?
for example I get date as string in this format 14 Jun 2011 Now I want to know the difference between current date and the date in string. Is it possible in word vba? Whay I want to achieve is Code:
If (CurrDate-strtxt) > 11 then some task If (currDate-strtxt) > 7 then some task Iff (currDate-strtxt)> 3 then some task |
#2
|
||||
|
||||
Try something based on:
Code:
Sub Demo() Dim MyDate As Date MyDate = CDate(InputBox("Please input a date", "Date Entry")) MsgBox "The # days difference between the input date and today is:" & vbCr & vbTab & Int(Now() - MyDate) End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
wordvba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assistance with VBA Code to identify and highlight dates in a word doc | shaunlthomas | Word VBA | 1 | 08-13-2015 05:25 PM |
Printing a series in Word docs with future dates | Rocky Vet at VAMC | Word | 2 | 04-04-2015 04:36 PM |
Changing Actual Finish dates changes original Finish dates | SomewhereinTX | Project | 3 | 12-20-2013 10:25 AM |
Sequential Dates in Word | Ultrap3 | Word | 2 | 02-04-2011 02:53 PM |
Stop Word from changing Folder DATES? | binar | Word | 0 | 08-12-2010 05:53 PM |