PowerPoint comments

Add-in Express™ Support Service
That's what is more important than anything else

PowerPoint comments
Not available in PowerPoint2000 or MSPpt2000.pas 
Guest


Guest


the comments property of a slide or slide range are not available in either of the two ocx server files (Powerpoint2000 for Delphi9 and MSPpt2000 for Delphi 7). Yet the procedures to display or hide comments are, which suggests that this feature did exist in PowerPoint 2000. Is there any way to expose the comments feature for 2000 as it has been in PowerPointXP?

Regards Nick
Posted 09 May, 2005 18:33:17 Top
Guest


Guest


Also, If I use XP, I can't seem to get an interface to Presentation.BuiltInDocumentProperties.

What type do I use as the first parameter to Intf.QueryInterface?

BuiltInDocumentProperties is defined as of Type IDispatch as a property of PowerPointXP._Presentation.

TIA Nick
Posted 09 May, 2005 20:19:48 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Nick,

PowerPoint 2000 doesn't contain the Comments property and the Comments collection. These new property and collection are in PowerPoint 2002 and higher.


Also, If I use XP, I can't seem to get an interface to Presentation.BuiltInDocumentProperties.

What type do I use as the first parameter to Intf.QueryInterface?


Try the IID_DocumentProperties guid.

Posted 10 May, 2005 10:14:11 Top
Guest


Guest


Hi Dmitry,

Thanks for that. If I use IID_DocumentProperties Guid as the first parameter, what type of variable do I use as the second parameter in Intf.QueryInterface?

As a matter of interest, I still need to use MSPpt2000.pas because the const Pres: _Presentation param for many of PowerPointApp events requires the older version, not PowerPointXP.pas. This is not a problem at the moment, but might be some time.

e.g.
OnNewPresentation(Sender: TObject; const Pres: _Presentation);
OnWindowActivate(Sender: TObject; const Pres: _Presentation; const Wn: DocumentWindow);
OnWindowDeactivate(Sender: TObject; const Pres: _Presentation; const Wn: DocumentWindow);
OnPresentationOpen(Sender: TObject; const Pres: _Presentation);

Regards Nick
Posted 11 May, 2005 00:09:48 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Nick,


Thanks for that. If I use IID_DocumentProperties Guid as the first parameter, what type of variable do I use as the second parameter in Intf.QueryInterface?


var
  Props: DocumentProperties;
begin
  Presentation.BuiltInDocumentProperties.QueryInterface(IID_DocumentProperties, Props);
  if Assigned(Props) then
    try
      // ...
    finally
      Props := nil;
    end;
end;
Posted 11 May, 2005 02:51:14 Top
Guest


Guest


Many thanks Dmitry, that did the trick,

the final code was:

DocAuthor: OLEVariant;
Props: DocumentProperties;
Prop:DocumentProperty;
begin
PowerPointApp.ActivePresentation.BuiltInDocumentProperties.QueryInterface(IID_DocumentProperties, Props);
if Assigned(Props) then
try
Props.Get_Item('Author',0,Prop);
Prop.Get_Value(0,DocAuthor);
finally
Props := nil;
Prop := nil;
end;

Would never have figured it out without your assistance, PowerPoint works very differently to other Office Apps. I couldn't understand why DocumentProperties wasn't in the PowerPointXP.pas, now I know it's an Office property, not a PowerPoint property. Have to do some reading of that file :-)

Thanks again Nick
Posted 11 May, 2005 05:20:21 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Nick,

MS Office family contains a great deal of interesting things.

Posted 11 May, 2005 06:53:44 Top
Kris


Guest


Hi

In my case this IID_DocumentProperties wont compile. Im trying to use with word
Posted 28 Oct, 2005 17:21:00 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Kris,

Please make sure the Office2000 unit is added to the uses clause.


Posted 30 Oct, 2005 08:42:02 Top
Kristjan H




Posts: 27
Joined: 2005-10-29
Thanks a lot, SUPERB SERVICE!
Posted 31 Oct, 2005 02:57:50 Top