![]() |
|
#1
|
|||
|
|||
![]()
Hi macropod, thanks so much for the response. I will admit that I am the worst type of programmer (IT exec playing as required to get reports out) so I am happy to hear any feedback, good or bad.
To answer your question, the process is to select a range in excel that contains the table data and then do a search for a placeholder in the word document. For example: Range("dep_comparison_table").Copy wrdObj.Selection.Find.Text = "<dep_comparison_table>" Call FormatPaste wrdObj.Selection.MoveLeft Unit:=wdCharacter, Count:=20 wrdObj.Selection.Tables(1).AllowAutoFit = False wrdObj.Selection.Tables(1).PreferredWidth = wrdObj.CentimetersToPoints(18.4) Sub FormatPaste() wdFind.Replacement.Text = "" wdFind.Forward = True wdFind.Wrap = wdFindContinue wdFind.Execute Call CheckClipBrd wrdObj.Selection.Paste CutCopyMode = False End Sub After all the tables are copied the tables are formatted with the following: For Each Table In wrdDoc.Tables Table.Select For i = 1 To Table.Rows.Count Table.Rows(i).Range.ParagraphFormat.KeepTogether = True If i < Table.Rows.Count Then Table.Rows(i).Range.ParagraphFormat.KeepWithNext = True End If Next i Next Table |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
pmstock | Word | 2 | 08-02-2014 08:34 PM |
![]() |
Mattblack | Word | 1 | 04-10-2014 03:06 PM |
![]() |
supersimu | Word | 1 | 01-25-2014 02:05 AM |
![]() |
Felipe | Word | 2 | 04-19-2012 07:35 AM |
![]() |
ghumdinger | Word | 2 | 08-18-2011 10:15 AM |