Word macro based on following text

D

Dwijadas

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
 
D

Doug Robbins - Word MVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top