U
Uwe
Word version: 97-2000
Background: I need to insert 200+ small (~40KB) pdf files into a Word
doc.
Doing it manually works fine via Insert->Object->Adobe Acrobat
Document.
Now I wanted to automate the process and wrote a little VB macro (see
insert example below, the final macro doesn't hard code the file name,
uses a loop and does some other things, but the code below
demonstrates the issue).
Problem: When I save the document where I inserted the file manually
it's ~80KB. However, a document where I inserted the file via the
macro is 1.5MB and it adds 1.5MB for each additional pdf.
I'm new to VB , so what am I missing? What is word adding when using
the macro?
I recorded a macro when inserting by hand it comes up with the same
code as in the macro below.
I tried Word 2007 and the doc does not swell up nearly as much,
however not everyone who needs the doc has 2007. Saving from 2007
to .doc format gives a huge document also.
Thank you
Sub Macro1()
Dim strFileName As String
strFileName = "D:\tmp\test.pdf"
Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.7",
_
FileName:=strFileName _
, LinkToFile:=False, DisplayAsIcon:=False
End Sub
Background: I need to insert 200+ small (~40KB) pdf files into a Word
doc.
Doing it manually works fine via Insert->Object->Adobe Acrobat
Document.
Now I wanted to automate the process and wrote a little VB macro (see
insert example below, the final macro doesn't hard code the file name,
uses a loop and does some other things, but the code below
demonstrates the issue).
Problem: When I save the document where I inserted the file manually
it's ~80KB. However, a document where I inserted the file via the
macro is 1.5MB and it adds 1.5MB for each additional pdf.
I'm new to VB , so what am I missing? What is word adding when using
the macro?
I recorded a macro when inserting by hand it comes up with the same
code as in the macro below.
I tried Word 2007 and the doc does not swell up nearly as much,
however not everyone who needs the doc has 2007. Saving from 2007
to .doc format gives a huge document also.
Thank you
Sub Macro1()
Dim strFileName As String
strFileName = "D:\tmp\test.pdf"
Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.7",
_
FileName:=strFileName _
, LinkToFile:=False, DisplayAsIcon:=False
End Sub