#1
|
|||
|
|||
VBA find replace within a line break
Hello everyone,
I am currently trying to modify my find and replace macro in order for it to read a line break. For example: I am trying to replace the following. Here is part of my code. Code:
Dim changedXml As String changedXml = Replace(strXml, "</graphic></figure></foldout>", "reproductionWidth=*+1") The only issue is the macro doesn't replace it because on my XML files they have line breaks between each one so it's making my macro not read them so nothing gets changed. This is how they look on my XML file: </graphic> </figure> </foldout> Does anyone know a solution to my problem? Thank you for any help in advance. Last edited by Rolo18; 04-30-2021 at 05:31 PM. |
#2
|
||||
|
||||
Code:
changedXml = Replace(strXml, "</graphic>" & Chr(11) & "</figure>" & Chr(11) & "</foldout>", "reproductionWidth=*+1")
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
||||
|
||||
Cross-posted at: ms word - VBA find replace within a line break - Stack Overflow
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find and Replace not capturing entire line | Steve Kunkel | Word VBA | 7 | 04-22-2021 10:00 AM |
Find and Replace Line Spacing | farisca | Word | 2 | 06-18-2020 04:02 PM |
Find / Replace hard Carriage Return with Line break. | GreenBoy | Word | 2 | 03-11-2018 02:32 AM |
Interchange line break and paragraph break shortcut keys | skan | Word | 2 | 01-20-2017 03:50 AM |
Bad view when using Find and Find & Replace - Word places found string on top line | paulkaye | Word | 4 | 12-06-2011 11:05 PM |