Results 1 to 4 of 4

Thread: How to create a real-time macro for Word?

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    56

    How to create a real-time macro for Word?

    I need to code a macro which will search and replace a particular text. But the problem is I need to run it in background permanently so that as soon as the user types the particular word and presses space bar to the type the next word, the replacing should take place then and there. Similiarly this should continue till the user closes the Word file.

    Any idea how to implement this?

  2. #2
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: How to create a real-time macro for Word?

    Hi,

    Do you have to do it using a macro, or is it just the task that you need to accomplish? If the latter, then you could just enter the word into AutoCorrect. if the former, then maybe you could use AutoCorrect anyway, but do it through code...

    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    56

    Re: How to create a real-time macro for Word?

    Actually search and replace was only the beginning. I need to do more options like changing color, underline etc...

    And the worst part.....all in real-time without disturbing the typing user.

  4. #4
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: How to create a real-time macro for Word?

    Could be a nightmare. The reason is that you can't use any of the normal methods of doing such things, because you can't move the insertion point if the user is still typing. If you can hook into the AutoCorrect to do all of these things for you, then I reckon that's your best hope.
    Have a look and see what you can do with it.

    zaza
    I use VB 6, VB.Net 2003 and Office 2010



    Code:
    Excel Graphing | Excel Timer | Excel Tips and Tricks | Add controls in Office | Data tables in Excel | Gaussian random number distribution (VB6/VBA,VB.Net) | Coordinates, Vectors and 3D volumes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width