View Single Post
 
Old 09-15-2014, 11:20 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The code only goes in the summary.
The code assumes that the document names you provided are correct.

The names are used at

Set oSourceA = Documents.Open(FileName:=oTarget.Path & "\" & "Dept A - detail.docx", AddToRecentFiles:=False, Visible:=False)
Set oSourceB = Documents.Open(FileName:=oTarget.Path & "\" & "Dept B - detail.docx", AddToRecentFiles:=False, Visible:=False)

If you add more rows then you will need to process those rows also. The code for a single row from one of the sources is

Code:
oTable.Cell(2, 3).Range.Text = oSourceA.Tables(1).Cell(2, 6).Range.Text     
oTable.Cell(2, 3).Shading.BackgroundPatternColor = oSourceA.Tables(1).Cell(2, 6).Shading.BackgroundPatternColor
The syntax is .Cell(Row, Column)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote