Solved

print word document from olecontainer

Posted on 1997-08-17
5
1,265 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

825 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