none
Macro to change "Dear VARIABLE, ^p" into "Dear VARIABLE: " RRS feed

  • Question

  • I edit and format letters that have varying names.

    I'm trying to build a Word macro to change "Dear VARIABLE, ^p" into "Dear VARIABLE: " and then apply a keyboard shortcut. 

    I am having difficulty finding the code or wildcard that allows me to use the find/replace feature this way.

    Friday, August 11, 2017 3:44 PM

All replies

  • I am having difficulty finding the code or wildcard that allows me to use the find/replace feature this way.

    Hi, I can hardly understand the meaning of the above.
    Would you explain it with other words?

    Ashidacchi

    Friday, August 11, 2017 9:32 PM
  • Try a wildcard Find/Replace, where:
    Find = (Dear [!^13]@), ^13
    Replace = \1: ^p
    Note1: It's not clear whether you have a space between the comma an paragraph break. The Find & Replace expressions both assume you and that you want to retain it. If not, omit the space after the comma and/or the colon.
    Note2: The Replace expression assumes you do want to retain a paragraph break. If not, omit the ^p.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Friday, August 11, 2017 9:44 PM