#16
|
|||
|
|||
Thanks a lot! Works fine. We can set this thread as solved.
__________________
Backup your original file before doing any modification. |
#17
|
|||
|
|||
Hi gmaxey, just one more little question, how can I merge two lines of text?
"The book is on the blue^p table next to the door." Result: "The book is on the blue table next to the door." I did this: "[!.:;]^13" to "^p", but does not work, the last character of the 1st paragraph disapear, resulting in "The book is on the blu table..." Note that the code should only join the rows if "^ p" is not preceded by "." or ";" or ":". Ps.: I did a trick, two passes, "[!.:;]^13", "^13¢", replace to "^&¢", " ". Seems to work fine. Thanks.
__________________
Backup your original file before doing any modification. Last edited by eduzs; 06-25-2017 at 07:08 PM. |
#18
|
||||
|
||||
You can do it in one
Replace ([!.:;"'])^13 with \1 (followed by a space)
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#19
|
|||
|
|||
Wildcard is like magic.
Thanks again! "Final" code, for collaboration purposes: Quote:
__________________
Backup your original file before doing any modification. |
#20
|
|||
|
|||
Your code as posted won't work for me. f you really want to collaborate then you should include the bit about:
Dim arrFind, arrReplace strLS = Application.International(wdListSeparator) etc., |
#21
|
|||
|
|||
Hi there gmaxey, I was thinking about a more user-frendly code, but I did a lot of customization and the code should not be useful for everyone.
I have a new question: In this mask: "([!.:;""])^13" how can I set not only a single caracter exception, but two or more, something like "([!.:'0 ;';""])^13" or "([!.:;'mary'""])^13" Thanks
__________________
Backup your original file before doing any modification. |
#22
|
||||
|
||||
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#23
|
||||
|
||||
Word's Find/Replace routine will not find empty paragraphs before a table. You need a different approach for that. For example:
Code:
Sub Demo() Dim Tbl As Table, Rng As Range On Error Resume Next For Each Tbl In ActiveDocument.Tables Set Rng = Tbl.Range.Characters.First.Previous Rng.MoveStartWhile vbCr, -1 Rng.Delete Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#24
|
|||
|
|||
Thanks macropod and gmaxey.
I was trying to modify this mask unsucessfull. "([!.:;""])^13" Works fine and does not find when there's a !, ., : or ; (for a single character it works fine). The problem is that I want it to not find also when there's a exact sequence of character like "xyz". I tried with "([!.:;<xyz>""])^13" not works. I read the link but didn't find something exactly like I was looking for.
__________________
Backup your original file before doing any modification. |
#25
|
||||
|
||||
Try:
Find = ([!.:;]xyz[" & Chr(34) & "”])^13
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#26
|
|||
|
|||
Macropod, gmaxey, gmayor thanks for helping.
Gmaxey and gmayor, I really liked your site, several examples of useful macros, developing macros for word, I think, is not as easy or intuitive as for excel, so we need forum help all the time. I think much of the difficulty of development is because of the endless number of objects and countless properties, in excel vba you can meet 90% of your needs only with workbook, sheets and cells objects.
__________________
Backup your original file before doing any modification. Last edited by eduzs; 07-01-2017 at 07:18 PM. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with replacing text with wildcards | sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
Why the "Text boundaries" are not shown till the end of the page while in other file | Jamal NUMAN | Word | 4 | 03-28-2012 07:58 AM |
outlook double spacing paragraphs | GWBDIRECT | Outlook | 3 | 04-06-2011 11:29 AM |
Replacing a single "l" with a double "ll" | MShroff | Word | 8 | 01-19-2011 08:43 AM |
Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |