![]() |
|
#1
|
|||
|
|||
|
Hi,
I am trying to modify the following macro to skip all tables in a document. I tried to add "tables" with the rest of the text that is ignored, but it still puts a "(U) " in each cell. Our text gets dumped out of another program and everything is styled "Normal"... including the tables. If I style the table text, then all the dollar amounts become left justified, which is time-intensive to fix. Does anyone have any suggestions? Code:
With ActiveDocument.Content.Find
.ClearFormatting
.Style = wdStyleNormal
Do While .Execute(Forward:=True, Format:=True) = True
With .Parent
If Left(.Text, 1) = vbCr Or Left(.Text, 1) = " " Or Left(.Text, 1) = chr(12) Or (wdWithInTable) Then
'do nothing
Else
.InsertBefore "(U) "
End If
If .End = ActiveDocument.Content.End Then
Exit Do
Else
.Move unit:=wdParagraph, Count:=1
End If
End With
Loop
End With
End Sub
Last edited by macropod; 09-24-2018 at 05:17 PM. Reason: Added code tags & formatting |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Convert particular blocks of text within a word document to tables using macro
|
benbob | Word VBA | 5 | 07-15-2018 03:20 AM |
word macro To insert text at the beginning and at end of paragraph
|
ArieH | Word VBA | 20 | 09-10-2017 04:23 PM |
Can't insert space at the beginning of a line in Word
|
p89.schneider | Word | 6 | 03-24-2016 11:38 PM |
Macro to Insert text into the beginning on specific paragraphs unless the paragraph is blank
|
caboy | Word VBA | 2 | 04-01-2015 07:00 AM |
| Looping macros to add text to beginning and end of a paragraph | pachmarhi | Word VBA | 0 | 02-16-2009 06:57 AM |