Solved

Printing the contents of an OLE Container (Word)

Posted on 2002-06-07
5
160 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
Comment Utility
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
Comment Utility
You may try the BitBlt API..

<listening..>
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
Comment Utility
' 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
Comment Utility
Sorry for the delay...project got the back burner, but I think that should work
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Thanks for "A" grade.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

744 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

16 Experts available now in Live!

Get 1:1 Help Now