Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have two variables vDateIni, vDateFin
I want to make a button that selects the values from date ini to date fin
Sub openPeriodo
dim vIni,vFin,cadena
set cadena = chr(10) 'str '' blank
set vIni = ActiveDocument.Variables("vDateIni")
set vFin = ActiveDocument.Variables("vDateFin")
for i = CLng(vIni.GetContent.string) to CLng(vFin.GetContent.string)
set cadena = CStr(cadena) & CStr(i) & chr(44) '44 is comma
next
ActiveDocument.Fields("numFecha").Select CStr(cadena)
End sub
My macro doesn´t work, fails
Anybody can help me?
The problem with doing this with a macro is that you lose the ability to make it work in AJAX. I would create a button with a "Select in Field" action instead. Use "numFecha" as your field name. For search string, enter the following: ='>=$(vDateIni)<=$(vDateFin)'
Regards,
Vlad
Try something like this...
sub SetDateRange
set StartDt = ActiveDocument.Variables("StartDate")
set EndDt = ActiveDocument.Variables("EndDate")
set PostDt = ActiveDocument.Fields("Post Date")
PostDt.Select ">=" + StartDt.GetContent.string + "<=" + EndDt.GetContent.string
end sub
The problem with doing this with a macro is that you lose the ability to make it work in AJAX. I would create a button with a "Select in Field" action instead. Use "numFecha" as your field name. For search string, enter the following: ='>=$(vDateIni)<=$(vDateFin)'
Regards,
Vlad
Hi Dan, Thanls a lot for your answer but I prefer the answer of Vlad that is better for me.
Hi Vlad, your system is better for me. it work´s fine.Thanks a lot.
I also like Vlad's suggestion better. We don't use AJAX currently, but I do like the idea of avoiding macros whenever possible.
Thanks,
Dan