Solved

Printing the contents of an OLE Container (Word)

Posted on 2002-06-07
5
161 Views
Last Modified: 2010-05-02
I need to print the contents of an OLE Container using word as the Embedded Object.  How do I do so from within VB?
0
Comment
Question by:dmoring
  • 3
5 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7063855
Instead of Using that, why don't you use Automation with word itself?
If you need the code, just ask.
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 7064995
You may try the BitBlt API..

<listening..>
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7065025
' Add a reference to microsoft word object library to your project

Option Explicit
Dim WordApp As Word.Application
Dim WordDoc As Word.Document

Private Sub Form_Load()
Set WordApp = New Word.Application
Set WordDoc = WordApp.Documents.Open("c:\mytest.doc")
With WordDoc
    .PrintOut
    .Saved = True
    .Close
End With
Set WordDoc = Nothing
WordApp.Quit
Set WordApp = Nothing

End Sub
0
 

Author Comment

by:dmoring
ID: 7117937
Sorry for the delay...project got the back burner, but I think that should work
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7118909
Thanks for "A" grade.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now