Solved

print word document from olecontainer

Posted on 1997-08-17
5
1,306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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