2012年3月3日土曜日

DRY (Don't Repeat Yourself) On WORD


If we do DRY(Don't Repeat Yourself) On MS Word, we might set "ID"s to some parts of WORD Document, for example , senetence , chart , table and so on.

I make a statistics report of MS Word document by Excel VBA.
I manage some parts of report , statistic values , charts , tables and text on Excel File.
And I copy their parts from Excel file to Word Document by VBA.









[ Excel ]

objRange.Select
Selection.Copy


[ Word ]

objDocument.Parent.Activate
Selection.PasteSpecial Link:=True _
                     , dataType:=wdPasteOLEObject _
                      , Placement:= wdInLine _
                      , DisplayAsIcon:=False

objDocument.Shapes(objDocument.Shapes.Count).Name = "tbl_1"



0 件のコメント: