Solved

2 fast ones, powerpoint and word stuff

Posted on 2003-11-06
6
378 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
Comment Utility
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
Comment Utility
All I get is ----> Interface not supported

:(

/Fixzy
0
 
LVL 3

Expert Comment

by:raidos
Comment Utility
Sorry about the delay...

You need to call
  OleContainer.DoVerb(ovShow);

When you have loaded your ContainerDocument....

Regards
//raidos
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Fixzy
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

6 Experts available now in Live!

Get 1:1 Help Now