Solved

print word document from olecontainer

Posted on 1997-08-17
5
1,256 Views
Last Modified: 2010-04-06
I need to print a winword document which is loaded in an olecontainer component (iconic := false). The command Print isn't supported whern iconic = false, so before printing i change iconic to True. then i send the command PRINT to the oleobject, and printing starts. The problem is that I need to go back right after the command PRINT is completted so i do OleContainer1.close which disactivate the WinWord server, but the print job is being spooling at that time and closing the server  stack the printing in spooling condition. what can i do to prevent that ? remember that i must use the close method because i want to change iconic back to False.
0
Comment
Question by:forger
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:miv
ID: 1341638
Have you tried: FOleWordContainer.OleObject.Application.ActiveDocument.PrintOut;

or is there a Printing property you can use ?
0
 
LVL 7

Expert Comment

by:RBertora
ID: 1341639
question: what are you trying to achieve and why
are you using the olecontainer...

I can do almost anything I want with word without
making use of an ole container...


Rob.

0
 

Author Comment

by:forger
ID: 1341640
Rob : "I can do almost anything I want with word without making use of an ole container... " 

Can you elaborate on that?
0
 
LVL 7

Expert Comment

by:RBertora
ID: 1341641
Am, well at the moment I am writing something
that will based on decision made in delphi code
generate a document, by writing in information
from Delphi,MSSQL database, generate graphs
in excell (using OLE) and import it into Word....

its very nice...

Cheers,
Rob.

0
 
LVL 1

Accepted Solution

by:
miv earned 200 total points
ID: 1341642
Forger: As RBertora writes, you don´t have to use an OleContainer.
Is there any problems doing like this:?

AVariant:=CreateOleObject('Word.Application');
AVariant.Application.ActiveDocument.PrintOut;
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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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