+ Reply to Thread
Results 1 to 7 of 7

VBA Script for Word - Auto change specific words

  1. #1
    Registered User
    Join Date
    08-27-2017
    Location
    London
    MS-Off Ver
    Don't know
    Posts
    4

    VBA Script for Word - Auto change specific words

    I've created a VBA script for Word to go through a document and contract certain words like: he is / he's

    However it doens't seem to work. Here is the script below. Please could someone tell me what's wrong. Also is there a better way to do this? How would I create a loop.

    If you're not sure of the latter that's fine but any help to get this working as is would be very much appreciated!


    Please Login or Register  to view this content.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA Script for Word - Auto change specific words

    Try:
    Please Login or Register  to view this content.
    Note: I've added a bunch more expressions (e.g. for 'who are/will, etc.' and 'I/you, etc. shall')
    Last edited by macropod; 08-28-2017 at 02:42 AM.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    08-27-2017
    Location
    London
    MS-Off Ver
    Don't know
    Posts
    4

    Re: VBA Script for Word - Auto change specific words

    This is fantastic Paul! Thank you, really appreciated.

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA Script for Word - Auto change specific words

    Your task, now, is to figure out how it works...

  5. #5
    Registered User
    Join Date
    08-27-2017
    Location
    London
    MS-Off Ver
    Don't know
    Posts
    4

    Re: VBA Script for Word - Auto change specific words

    Absolutely. I'm going through this line by line!

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA Script for Word - Auto change specific words

    Hint:
    .MatchWildcards = True

    PS: I just noticed a few typos and revised the code accordingly. Try the updated code.
    Last edited by macropod; 08-28-2017 at 02:43 AM.

  7. #7
    Registered User
    Join Date
    08-27-2017
    Location
    London
    MS-Off Ver
    Don't know
    Posts
    4

    Re: VBA Script for Word - Auto change specific words

    Thank you - I did spot them and made the changes as I was going through. Thanks again for your help.

+ 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. Extract rows to another sheet based on specific words + auto updates
    By scooter2012 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-13-2022, 09:17 PM
  2. Find / Extract Word & Words after a Specific Word
    By roseuz in forum Excel General
    Replies: 8
    Last Post: 07-05-2017, 01:07 PM
  3. Replies: 1
    Last Post: 02-21-2016, 02:39 AM
  4. Extract words/numeric after each specific word
    By chweetvjy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2014, 06:40 AM
  5. Replies: 1
    Last Post: 01-30-2013, 04:41 AM
  6. Replies: 3
    Last Post: 04-26-2011, 11:57 AM
  7. [SOLVED] search for a specific word and copy the word and the preceeding words until a comma
    By DHANANJAY in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-31-2005, 09:10 AM

Tags for this Thread

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