Print Embedded Attachments from within Word 2000 doc 
Author Message
 Print Embedded Attachments from within Word 2000 doc

I posted this several days ago in the beginner's group but
got no response -- hopefully someone in this group can
help me.  Thanks!
----------------------------------------------------

I have a macro that prints all doc attachments that are
embedded as objects in a Word 2000 document (code provided
at end of doc).  I have it set to to skip those with PROG
ID of "package" but print all others (like Excel spread
sheets , other Word docs, etc.).

It works fine for Word docs but I have 2 problems:

1. It doesn't print Excel spreadsheets even though they do
not appear with and ProgID of "package".  I suspect I need
to switch control somehow to Excel to open the sheet then
print then close it but I'm not sure if that is true
and/or if there is an easier way. Also, I don't know how
to do this if it is needed.

2.  I also want to be able to print items with .txt
extensions but they have an ID of "package". Any one know
how I can programmatcally open/print these docs? I could
check for file extension .txt but then how do I get it to
open/print it? I suspect that would put me in the same
bind as #1 -- opening/printing via another application
(i.e. notepad?)?

Thanks for your help!
JoAnn

Here is mycode:

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
.



Sat, 31 Dec 2005 20:38:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Print formatting problems -- Using VBA in Access 2000 to print a doc in Word

2. Printing Word Doc from Access 2000 (Margins)

3. Printing an embedded word doc???

4. reformat word 2000 doc into word 97 format

5. Insert an embedded word doc from access in word

6. Automating email function within Word 2000 using Access 2000

7. Word 2000 from within VB: Windows 2000: error, Windows ME: ok

8. Adjusting an Embedded Excel Worksheet in Word 2000

9. Embedding/automating MS Word 2000 - help!

10. Word Doc embedded in report

11. Update a Table of Contents on a doc created from a template Word 2000

12. Large number of list templates in a word 2000 doc

 

 
Powered by phpBB® Forum Software