+ Reply to Thread
Results 1 to 4 of 4

Find and Replace in Word document through Excel VBA

  1. #1
    Registered User
    Join Date
    06-27-2014
    Location
    Comillas, Spain
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Lightbulb Find and Replace in Word document through Excel VBA

    Hi guys,

    I am trying to develop a code in Excel VBA that will collect all the data gathered through a Userform and then Find and Replace all that information in a dummy contract.

    I have succesfully programmed all the Excel part of this process, however from some reason I cannot get Excel to Find and Replace in the Word document I specify.

    Here's the code I have thus far for this bit of the process:

    Please Login or Register  to view this content.
    Any help will be appreciated!

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Find and Replace in Word document through Excel VBA

    You're trying to use the document object as a variable.

    Instead, use this.
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    06-27-2014
    Location
    Comillas, Spain
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: Find and Replace in Word document through Excel VBA

    Hi Tinbendr,

    Thanks for pointing that out, although I still get the same error when running the code at exactly this point:

    Please Login or Register  to view this content.
    Any thoughts?

    Thanks!

  4. #4
    Registered User
    Join Date
    06-27-2014
    Location
    Comillas, Spain
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: Find and Replace in Word document through Excel VBA

    I just figured out a workaround for this, it is pretty basic but serves my needs.

    I will leave it here for the rest of the community to see it and improve it:

    Please Login or Register  to view this content.

    Quote Originally Posted by javi-xls View Post
    Hi Tinbendr,

    Thanks for pointing that out, although I still get the same error when running the code at exactly this point:

    Please Login or Register  to view this content.
    Any thoughts?

    Thanks!

+ 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. [SOLVED] Find and replace in word document
    By bruizer31 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 06-18-2013, 09:14 PM
  2. Use Excel VBA for editing and find/replace in a Word document
    By drdavidge in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-05-2013, 06:10 AM
  3. Highlight certain words in Word document after running find-and-replace from Excel
    By EnterTheSerpent in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 02:27 PM
  4. Find and Replace the styles in the word document
    By nnram123 in forum Word Formatting & General
    Replies: 2
    Last Post: 12-21-2010, 01:52 PM
  5. Replies: 2
    Last Post: 07-11-2005, 12:05 PM

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