Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro for Word 365 - adding quotations before and after text

    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!

  2. #2
    Super Moderator macropod's Avatar
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,198
    Thanks
    2
    Thanked 460 Times in 379 Posts
    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
    [MS MVP - Word]

  3. #3
    5 Star Lounger Lugh's Avatar
    Join Date
    Jun 2010
    Location
    Indy
    Posts
    828
    Thanks
    209
    Thanked 106 Times in 93 Posts
    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.

    Quote Originally Posted by Earwiglet View Post
    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.
    ~
    Dell Alienware Aurora R6 (new 2017)
    Windows 10 Home x64 1703; Office 365 x32
    GeForce GTX 1060; 16GB DDR4 2400
    256G SSD, 1TB HD

Tags for this Thread

Posting Permissions

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