Solved

Printing the contents of an OLE Container (Word)

Posted on 2002-06-07
5
163 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 50

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

821 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