Solved

2 fast ones, powerpoint and word stuff

Posted on 2003-11-06
6
383 Views
Last Modified: 2010-04-05
Hi all

1st Q: I have a ppt file in a OLEcontainer. Is there any way to get the pictures count (number of sheets in the pressentation)?

2nd Q: I also have a word file inside a OLEcontainer, the container is NOT visible, BUT i want to be able to pront the wordfile without making it visible.

Anyone?

Thanx
Fixzy
0
Comment
Question by:Fixzy
  • 3
  • 3
6 Comments
 
LVL 3

Accepted Solution

by:
raidos earned 50 total points
ID: 9699800
1: I Would guess something along the lines of :
   ShowMessage(IntToStr(OleContainer.OleObject.Slides.Count));

2: I Would guess something along the lines of :
  OleContainer.OleObject.PrintOut(BackGround := TRUE); //Or False if you want to see some info...

Regards
//raidos
0
 

Author Comment

by:Fixzy
ID: 9703363
All I get is ----> Interface not supported

:(

/Fixzy
0
 
LVL 3

Expert Comment

by:raidos
ID: 9721578
Sorry about the delay...

You need to call
  OleContainer.DoVerb(ovShow);

When you have loaded your ContainerDocument....

Regards
//raidos
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

Author Comment

by:Fixzy
ID: 9725808
Thanx....now the slide numbering works.

But  OleContainer.OleObject.PrintOut(BackGround := TRUE); does not work the method PrintOut is not supported *argh*...starting to disslike OLE :(.
By the way, I use D4
0
 

Author Comment

by:Fixzy
ID: 9725832
Forget it...Now it works, I did not switch to a word file.

But it does not work if I set the OLE container to visible=false (I dont want the user to be able to open the word file, only to print it)

Fixzy
0
 
LVL 3

Expert Comment

by:raidos
ID: 9730350
OLE Containers are the devil!!

Best suggestion i can come up with is don't do it in a container...do it in a regular ole object...

Uses ComObj;

Var
  WordApp: Variant;
Begin
  WordApp := CreateOleObject('Word.Application');
  WordApp.Visible := FALSE;
  WordApp.Documents.Open(FileName:='C:\Path\To\YourDoc.Doc'; ConfirmConversions:=FALSE; ReadOnly:=TRUE);
  WordApp.ActiveDocument.PrintOut(Background := TRUE);
  WordApp.Application.Quit(SaveChanges:=FALSE);
End;

Or something like that..

regards
//raidos
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

790 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