Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi 2005 Export to powerpoint 2007 COM Interface 1

Status
Not open for further replies.

Saamiya

IS-IT--Management
Mar 10, 2008
2
US
Hi,

I am having trouble exporting to powerpoint 2007 ( office 2007) by using Delphi 2005. Application uses COM object to communicate to powerpoint from Delphi. The same code works fine for office 2000 & office XP but do not work with Office 2007.

Surprising thing is export to excel functionality works fine with all the versions of MS Offices ( 2000, XP and 2007).

But, I get an error when application executes the following line of code in

FPresentation := FPowerPoint.Presentations.Open(FTemplateName,msoFalse,msoTrue,msofalse);

The error says Server execution failed, ClassID: { 91493441-5A91-11CF-8700-00AA0060263B}.

CodeGear told me that Microsoft has changed the interfaces for PowerPoint 2007 and they do not support at the moment this functionality even in the latest version which is delphi 2007.

Is there any workaround? Or Is there any thirdparty component with which I can achieve this functionality?

Please help. Thanks in advance.

Regards,

Ktuser
 
Import office interfaces the mso.dll for Office_TLB.pas and STDOle2.TLB for PowerPoint_TLB.pas. Place them in the .../OCX/Server folder and add to the units uses clause.

And Debug my code found that the actual cause of the error is IndentLevel. By default indent level is 0 , means no indentation, in my application which was acceptable in the previous version of PowerPoint application. This has been changed for PowerPoint 2007, now no indentation has value 1. Here is the reference from MSDN.

"TextRange.IndentLevel Property PowerPoint Developer Reference
Returns or sets the the indent level for the specified text as an integer from 1 to 5, where 1 indicates a first-level paragraph with no indentation."

Thanks for your quick response guys. You both should get 250 points each.
 
star for finding your own solution.
I don't have D2007 so I couldn't help you.

"this ain't experts-exchange"

Cheers,
Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top