• Macro for Word 365 – adding quotations before and after text

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Macro for Word 365 – adding quotations before and after text

    • This topic has 2 replies, 3 voices, and was last updated 9 years ago.
    Author
    Topic
    #505696

    Hi everyone,

    I am new to the world of macros – I’ve just learned about recording them and I’m pretty excited by the possibilities!

    I have multiple reports to write, each of which requires me to take multiple short paragraphs and format them. I have created a macro that allows me to bold, italicise etc in one go, but is there any way that I can insert double quotation marks both before and after each comment? And ideally I’d like to find a way to make sure that there is a full-stop at the end of the paragraph/sentence.

    E.g.

    my manager needs to stop micromanaging me –> “My manager needs to stop micro-managing me.”

    I am using Word 365 but hopefully this shouldn’t impact macro usage…right?

    Any help here would be so greatly appreciated!

    Viewing 1 reply thread
    Author
    Replies
    • #1565158

      How would Word identify where a comment starts/ends?

      As for:

      I have created a macro that allows me to bold, italicise etc in one go

      The proper way to do this is by creating/modifying and applying an appropriate paragraph Style – no macros required.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1565500

      As Macropod implies, you should familiarize yourself with templates and styles first. Get those essential foundations working solidly before you start automating. Trying to automate poorly constructed documents is a frustrating time sink.

      is there any way that I can insert double quotation marks both before and after each comment?

      Assumption is each comment is in its own paragraph, and there are no other paragraphs in the document [if there are other non-comment paragraphs, you could use a separate doc to prep the comments].
      Record a macro which globally replaces
      ^p
      with
      “^p”
      That will cause double quotes at the beginning and end of each paragraph [^p is the code for the paragraph mark, I recommend you turn on viewing them, and other formatting marks, as your default].

      a way to make sure that there is a full-stop at the end of the paragraph/sentence.

      Similar global replace macro.
      1. In case there are ellipses represented by three separate dots, first global replace

      with

      2. Global replace
      ^p
      with
      .^p
      3. Global replace
      ..^p
      with
      .^p

      Make sure you do each global replace more than once, to ensure that all instances are caught.

      But I strongly advise getting to grips with templates and styles before doing much automation, they’re the key to reliable efficient and productive use of Word.

      Lugh.
      ~
      Alienware Aurora R6; Win10 Home x64 1803; Office 365 x32
      i7-7700; GeForce GTX 1060; 16GB DDR4 2400; 1TB SSD, 256GB SSD, 4TB HD

    Viewing 1 reply thread
    Reply To: Macro for Word 365 – adding quotations before and after text

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: