Posted on
Saturday 13 March 2010
Microsoft Word documents can contain attached/embedded documents, such
as MS Word documents or MS Excel spreadsheets. Such documents are
shown as clickable icons when the "parent" document is viewed in MS
Word.
As it is now, I am unable to print the parent document and all its
"children" in one single operation. I have to manually open and print
each of the attachments, which can be very tedious if the document has
lots of attachments.
I want MS Word 2003 to print all such embedded documents with a single
command. Can you provide me with a macro/script that will accomplish
this?
(Having done a bit of research myself, I have not found any solutions
on the web. The nearest I got was a five year old Usenet discussion,
see http://groups.google.com/group/microsoft.public.word.newusers/browse_frm/thread/8cc98298a64c9569/)Hm. Looks like I'll have to live with this snag.I have found a solution that seems to work:
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
(http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/cb35eaf1f5a28cd4/)
I am testing this solution now. Please don't answer my question
unless I report back that this method does not work...I have tested the macro above, and it works OK, but with the flaws
described in the message at
http://groups.google.com/group/microsoft.public.word.vba.general/browse_thread/thread/cb35eaf1f5a28cd4/
- i.e., only MS Word attachments are printed. Can anyone provide a
solution to this?#If you have any other info about this subject , Please add it free.# |
|