From: Dwijadas on
Hi,
I need to call a date convert macro from Word. I have the macro which
can covert the date from one format to another but every time need to
run the macro.
Let me put that as an example.
Last Due Date : 40170 - this is relative date. I have macro to
convert this.
as soon as i type the macro behind the number, it should convert it.
Last Due Date : 40170=cdate ---should call the macro and next
moment macro does
Last Due Date : 40170=23-12-2009
issue here, how can activate the macro :)
thank you very much for your help.
regards,
Dwija
From: Doug Robbins - Word MVP on
Instead of typing =cdate, assign your macro to the keyboard and, if
necessary use the following as the first line of your macro:

Selection.MoveStart wdWord, -1

If you then type the keyboard combination to which you assigned the macro
immediately after typing in the relative date, the start of the selection
will be moved to the start of the relative date so that Selection.Text will
return the relative date for use by the code that you now have.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Dwijadas" <dwijadas(a)gmail.com> wrote in message
news:fef78f85-9264-481a-babf-513ce859f904(a)j36g2000prj.googlegroups.com...
> Hi,
> I need to call a date convert macro from Word. I have the macro which
> can covert the date from one format to another but every time need to
> run the macro.
> Let me put that as an example.
> Last Due Date : 40170 - this is relative date. I have macro to
> convert this.
> as soon as i type the macro behind the number, it should convert it.
> Last Due Date : 40170=cdate ---should call the macro and next
> moment macro does
> Last Due Date : 40170=23-12-2009
> issue here, how can activate the macro :)
> thank you very much for your help.
> regards,
> Dwija