Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How will you calculate Date range from start date to end date
set sd=ActiveDocument.Variables("sd")
msgbox("StartDate"&sd.GetContent.String)
set ed=ActiveDocument.Variables("ed")
msgbox("EndDate"&ed.GetContent.String)
edate=CDate(ed.GetContent.String)
sdate=CDate(sd.GetContent.String)
set endate=CDate(edate-sdate)
for i=0 to endate.count -1
msgbox("New Date:"&endate.item(i).text)
next
using this i got .....
first find the date differnce... from that we calculate remaining easily...
sub ed_final
set sd=ActiveDocument.Variables("sd")
'msgbox("StartDate"&sd.GetContent.String)
set ed=ActiveDocument.Variables("ed")
'msgbox("EndDate"&ed.GetContent.String)
edate=CDate(ed.GetContent.String)
sdate=CDate(sd.GetContent.String)
endate=DateDiff("d",sdate,edate)
'msgbox(endate)
ActiveDocument.Fields("ncolum").select sdate+1
for i=2 to endate
ActiveDocument.Fields("ncolum").ToggleSelect sdate+i
next
end sub
Hi
I am not too sure whether it helps you or not. But it is related to date range only. You can look into it!