![]() |
|
|
|
#1
|
|||
|
|||
|
Here is what I tried after including the If test, but I get a "Compile Error: Method or data member not found"
It debugs to - .Text I'm I right on thinking the [3-4] should be changed to [3] if I'm starting with Attachment 3 as the beginning point? Code:
Sub Add_Rows_Table()
Application.ScreenUpdating = False
Dim Tbl As Table, Rng As Range
For Each Tbl In ActiveDocument.Tables
With Tbl
If .Range.Characters.First.Previous.Paragraphs.Last.Text Like "Attachment [3]" & vbCr Then
.Rows.Add
Set Rng = .Range
.Range.Cells(.Range.Cells.Count).Range.InsertBreak Type:=wdColumnBreak
Rng.Tables(2).Range.Cells.Merge
.Range.Characters.First.Previous.InsertBefore vbCr
.Range.Characters.First.Previous.Previous.FormattedText = Rng.Tables(2).Range.FormattedText
Rng.Tables(2).Delete
.Range.Characters.First.Previous.Delete
.Range.Characters.Last.Next.Delete
End If
End With
Next Tbl
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How do I mail merge records into table columns with more than one merge field?
|
tech123 | Mail Merge | 1 | 04-26-2017 07:13 PM |
Table Merge
|
murazlan | Mail Merge | 3 | 11-21-2016 08:05 PM |
Merge only the text in a table and keep the 2 original colums of a table
|
james1979uk | Word Tables | 5 | 12-15-2013 05:48 PM |
| Cannot Merge Into A Table | MacDee | Mail Merge | 1 | 01-29-2013 07:21 PM |
Merge Two Table in VBA
|
donbexcel | Word VBA | 2 | 10-21-2011 11:46 AM |