Printing embedded documents in MS Word 2003

  • Thread starter Karl Erik Birkeland
  • Start date
K

Karl Erik Birkeland

I wish to print a document INCLUDING its embedded document objects
(shown as clickable icons) in MS Word 2003 in one single operation. As
it is now, I have to manually open and print each of the attachments,
which can be very tedious if the document has lots of embedded files.

I found a message on microsoft.public.word.vba.general
(http://groups.google.com/group/micr...eneral/browse_thread/thread/cb35eaf1f5a28cd4/)
that included a VBA script (attached below) that solves this problem
partially - only MS Word objects are handled properly. Does anyone
have a solution that will work with MS Excel and plain-text objects as
well?

Sub PRINT_Attachments()
'
' PRINT_Attachments Macro -- to print attachments in a doc
' Comments: TYPE=1 is an embedded object
x = 0
x = ActiveDocument.InlineShapes.Count

Do While x <> 0
If ActiveDocument.InlineShapes(x).Type = 1 Then
If ActiveDocument.InlineShapes(x).OLEFormat.ProgID <> "Package" Then
ActiveDocument.InlineShapes(x).Activate
ActiveWindow.PrintOut
ActiveWindow.Close
End If
End If
x = x - 1
Loop
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top