Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-25-2020, 12:24 AM
macropod's Avatar
macropod macropod is offline Replacing a string from one doc to another doc Windows 7 64bit Replacing a string from one doc to another doc Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Done correctly, it works. Without actually seeing your two documents, I can't be sure what it is you've done.
If, as I suspect, your table is as per the OP's 'Fixed version (replacing document).docx ' attachment (which isn't actually the fixed version), you need to change:
Code:
      .Text = Split(Tbl.Cell(r, 2).Range.Text, vbCr)(0)
      .Replacement.Text = Split(Tbl.Cell(r, 3).Range.Text, vbCr)(0)
to:
Code:
      .Text = Split(Tbl.Cell(r, 1).Range.Text, vbCr)(0)
      .Replacement.Text = Split(Tbl.Cell(r, 2).Range.Text, vbCr)(0)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
word replacing



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing a string from one doc to another doc Wildcard replace any string in context with a specified string wardw Word 7 05-07-2018 09:13 AM
Replacing a string from one doc to another doc How can I compare a string in a cell to another string? Amitti Word VBA 2 04-10-2017 07:35 PM
How to find all string within string. PRA007 Word VBA 18 02-12-2016 08:11 PM
Replacing a string from one doc to another doc Way to search for a string in text file, pull out everything until another string? omahadivision Excel Programming 12 11-23-2013 12:10 PM
Replacing text string within document, it's not retaining formatting livemusic Word 4 02-25-2013 12:33 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft