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
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 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
    627
    Thanks
    168
    Thanked 77 Times in 68 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.
    ~
    Windows 10 Pro x64 1607; Office 2016 (365 Home) x32; Win Defender, MBAM Pro

    ASRock H97 Anniversary; Xeon E3-1231V3 (like i7)
    Gigabyte GeForce GTX 970; 12GB Crucial DDR3 1600
    Logitech MX Master mouse; Roccat Isku kb

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
  •