Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 03-19-2017, 12:13 AM
gmayor's Avatar
gmayor gmayor is offline how to replace a text in word by cell value (bulleted text) using macro Windows 10 how to replace a text in word by cell value (bulleted text) using macro Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Without having the materials to test, something like the following may work, Chr(183) is the bullet character. Note that if you are using late binding to Word you need to use the numeric equivalents of the 'wd' commands (see below).

Code:
If Ans <> vbNullString Then
       ReplaceAns = Replace(Ans, Chr(32) & Chr(183), vbCr & Chr(183))
       For Each rngStory In oWordDoc.StoryRanges
              With rngStory.Find
                    .Text = FoundWord
                    .Replacement.Text = ReplaceAns
                    .Wrap = 1
                    .Execute Replace:=2
              End With
       Next
End If
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Cell Text to paste into Find/Replace CBarry Word VBA 2 02-16-2017 04:37 AM
how to replace a text in word by cell value (bulleted text) using macro Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
how to replace a text in word by cell value (bulleted text) using macro Macro to search warning text style and replace the text color rohanrohith Word VBA 3 11-27-2014 01:08 PM
Macro to find coloured text and replace with form-field/formtext containing that text tarktran Word VBA 1 11-26-2014 08:12 AM
how to replace a text in word by cell value (bulleted text) using macro Word VBA Macro to Find and Replace based on the Alt Text of an Image bennymc Word VBA 1 01-27-2014 04:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:30 PM.


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