+ Reply to Thread
Results 1 to 2 of 2

I need a macro that will search out quickparts and activate them

  1. #1
    Registered User
    Join Date
    02-13-2019
    Location
    St Paul, Minnesota
    MS-Off Ver
    2013
    Posts
    2

    Exclamation I need a macro that will search out quickparts and activate them

    In my office we have a set of auto text/quickparts that all end in ~~ (This can be changed fairly easily). When we see ~~ it is a tag that prompts us, as individuals, to use the quickpart.

    Due to regulatory changes we need to add another 13 auto text pieces into the letters that we write. This will be a pain to do manually along with all the other changes we need to do. I want to make this all a heck of a lot easier for everyone (If this works it will literally 100's of man hours). This is a bit of a drastic change so the non-compliance issues will delay the benefits we are trying to provide.

    I currently have a macro that searches out small things and replaces them with the correct things (ie. lower case veteran with upper case Veteran or word "Death" with the word "Survivor") The terminology has evolved over the years so words like these need to be updated. The basic letter writing tool needs a drastic rewrite but no funding means I have to find workarounds. The macro has been utilized 10% of the workforce and everyone uniformly says it saves them several hours every month (small but every little bit helps). I have a proposal that is currently at the higher level for this "tool" to be used by everyone, but due to the recent changes I mentioned above I want to make it better. Since I don't know VBA (I use the record function to do most things) I can't figure out how to get this to work. I'm really good at copy pasting :D and complex formulas in excel so hopefully with some direction this won't be too difficult for me to implement

    What I want to do is:
    1. Run a macro that finds specific text in the letters and replace them with a quick part autotext tag (I got this part covered)
    2. The Macro will then find and activate each autotext tag turning it into the full text and tables, etc (This is what I have no clue how to work)
    3. Repeat Step 2 until all of the Tags have been updated. (Also, no clue)
    4. Stop (On my first attempt I made a loop that crashed the macro)

    For the life of me I can't figure it out but I know it is possible. I just haven't been able to figure it out and these changes become mandated next week.

    Help! Thanks
    Last edited by MalkavTepes; 02-14-2019 at 07:54 AM. Reason: Removed unnecessary title part, Clarity

  2. #2
    Registered User
    Join Date
    02-13-2019
    Location
    St Paul, Minnesota
    MS-Off Ver
    2013
    Posts
    2

    Re: I need a macro that will search out quickparts and activate them

    I found a solution to my problem. Thanks for reading!

    Selection.HomeKey wdStory
    Do
    With Selection.Find
    .ClearFormatting
    .Text = "~"
    .Forward = True
    .MatchWildcards = False
    .Execute
    If .Found = False Then Exit Do
    End With
    Selection.Collapse wdCollapseStart
    Selection.Range.InsertAutoText
    Selection.Delete
    Loop

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-14-2017, 07:34 AM
  2. Accessing Document Quickparts
    By jlt199 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2016, 04:58 AM
  3. [SOLVED] VBA: Search cell value multiple sheets, then activate sheet
    By goranimo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-06-2016, 08:32 AM
  4. [SOLVED] Activate word document from excel, run macro, copy results then activate excel
    By k1989l in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2016, 08:27 AM
  5. Search Down Column, Activate Row from Columns A:X and Add Selection to Listbox
    By Zemillard in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-01-2014, 02:56 PM
  6. Search column and activate cell where true
    By iii in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2009, 07:19 PM
  7. [SOLVED] search all sheets in book to find value and activate sheet with va
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2005, 04:50 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1