gaqonline.blogg.se

Microsoft word find and replace macro
Microsoft word find and replace macro











microsoft word find and replace macro

Find object, a whole passel of properties are specified. I'll get back to the first two lines of this code in a moment but take look at all the other lines produced. For instance, I recorded searching for the word "the" and replacing it with the word "THE." When I stopped the macro recorder and looked at what it created, this is the relevant part of what I saw:

microsoft word find and replace macro

One easy way to figure things out is to simply record a macro that does the Find and Replace operation, and then look at the code that the recorder produces. With doing find and replace operations, there are a number of objects that can be involved, and each of those has a goodly number of properties. If you cannot figure out what your macro will change, you cannot proceed with the other steps.

  • Restore those properties from the variables you earlier set in step 3.
  • Store the properties in the variables you created.
  • Create variables in which to store all the properties that will be changed.
  • The idea in implementing this practice is to follow these steps: That way your macro won't mess up anything else that the user may be doing. So, Simao wonders where to find all of the properties for search and replace so he can save them at the start of each macro and then restore them at the end.Īs Simao alludes to, "good practice" is to have your macro return anything it changes to whatever state it was in before the macro ran. However, when the macros finish, he'd like to restore the search and replace parameters to the ones in effect just before he ran the macros.

    microsoft word find and replace macro

    Simao has some macros doing a lot of searching and replacing.













    Microsoft word find and replace macro