• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

2 fast ones, powerpoint and word stuff

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
Fixzy
Asked:
Fixzy
  • 3
  • 3
1 Solution
 
raidosCommented:
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
 
FixzyAuthor Commented:
All I get is ----> Interface not supported

:(

/Fixzy
0
 
raidosCommented:
Sorry about the delay...

You need to call
  OleContainer.DoVerb(ovShow);

When you have loaded your ContainerDocument....

Regards
//raidos
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
FixzyAuthor Commented:
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
 
FixzyAuthor Commented:
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
 
raidosCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now