Solved

2 fast ones, powerpoint and word stuff

Posted on 2003-11-06
6
379 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
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.

 

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

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

Suggested Solutions

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…
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 video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

863 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

18 Experts available now in Live!

Get 1:1 Help Now