+ Reply to Thread
Results 1 to 5 of 5

Replacing existing Text in Word doc with another text

  1. #1
    Forum Contributor
    Join Date
    08-20-2019
    Location
    Mumbai
    MS-Off Ver
    Office 365
    Posts
    101

    Replacing existing Text in Word doc with another text

    I am using a userform to update some text in a word document.

    As of now I have bookmarked the place in Word doc. and use the below code to enter a value from a userform combobo or textbox. This method inserts the control value in the word file. It does not replace the text. I tried searching for option around the WordDoc.Bookmarks("TextArea").Range. method, but couldn't find any.

    How do I replace the text with new text?

    Please Login or Register  to view this content.
    Above code works fine when the bookmark is a blank space and I need to insert a fresh text.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Replacing existing Text in Word doc with another text

    You posted in the Excel forum?

  3. #3
    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: Replacing existing Text in Word doc with another text

    Quote Originally Posted by Pepe Le Mokko View Post
    You posted in the Excel forum?
    Perhaps because Word is being automated. Still, this would have been better posted in the Word programming forum.

    See: https://www.excelforum.com/excel-pro...ml#post5125008
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,443

    Re: Replacing existing Text in Word doc with another text

    Moved to the Word VBA forum

  5. #5
    Forum Contributor
    Join Date
    08-20-2019
    Location
    Mumbai
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Replacing existing Text in Word doc with another text

    Thanks Pepe. I will be careful next time in selecting Forum.
    Thanks Paul: Yes, this is part of an Excel Automation tool. Your post was useful.

+ 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] Replacing a word in the middle of a string of text with another
    By batexcel in forum Excel Formulas & Functions
    Replies: 36
    Last Post: 06-13-2019, 09:22 AM
  2. Req: VBA for replacing random words in generated text with word DELETED
    By dhous007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2018, 07:30 AM
  3. VBA to copy selected text from outlook item to existing word doc
    By bensox in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-14-2014, 01:33 PM
  4. Question about replacing Word text from Excel in many files
    By Dreamwine59 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2008, 03:13 PM
  5. Replacing Word text with Excel data problem
    By PaulC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2006, 11:59 AM
  6. [SOLVED] replacing text in all cells with existing text plus something
    By avi2001 in forum Excel General
    Replies: 2
    Last Post: 11-02-2005, 06:20 PM
  7. Replies: 2
    Last Post: 11-02-2005, 06:17 PM

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