PowerPoint version conflict

A

Abhishek Bagga

Hi!

I have written a code in which I am opening the PowerPoint file. I added the
references of PowerPoint and Office to my project.
First of all I have to add different references for 2000 and XP is there a
way out through which I can open the PowerPoint2000 using PowerPoint XP dll
If there is then solves most of my problem.

I am using the following code to open the PowerPoint file.

(Office XP/2003)
m_PPTPresentation=m_PPTApp.Presentations.Open(m_PPTFilePath,Microsoft.Office.Core.MsoTriState.msoTrue,Microsoft.Office.Core.MsoTriState.msoTrue,Microsoft.Office.Core.MsoTriState.msoFalse);


(Office 2000)
m_PPTPresentation=m_PPTApp.Presentations.Open(m_PPTFilePath,Office.MsoTriState.msoTrue,Office.MsoTriState.msoTrue,Office.MsoTriState.msoFalse);

If the system on which my application is running has PPT 2000, then XP dll
fails, so I have to chk the ppt version and dynamically link the PPT 2000
dll.
I am able to acheive this and it runs fine.
The problem is that if on this particular system , Office XP was installed
and then uninstalled for some reason, the assembly cache keeps the office XP
dlls and the program fails.
Similar situation also arises if the PIA's are installed on the system
having office 2000

The above code fails in both the scenarios on systems having office 2000. In
such a case I am unable to run my application and the only solution I have
is to format the system or ask the user to upgrade to office xp (Both the
options are not practical)

Any suggestions


- Abhishek
 
S

Steve Rindsberg

I'm not a .Net user so I may be misunderstanding what you're doing here, but
it appears that the only difference between the versions is the way you
reference the parameters (Microsoft.Office.Core.xxx vs Office.xxx).

Can you pass literals or your own constants instead of the Office
enumerations?

If not, can you invoke PPT and query YourPPTObject.Application.Version then
branch to the appropriate code for that version?
 
A

Abhishek Bagga

Steve Rindsberg said:
I'm not a .Net user so I may be misunderstanding what you're doing here,
but
it appears that the only difference between the versions is the way you
reference the parameters (Microsoft.Office.Core.xxx vs Office.xxx).

Can you pass literals or your own constants instead of the Office
enumerations?

"No we cannot pass literals to it sincethe methos expects the office
type.Tristate object as true or false."


If not, can you invoke PPT and query YourPPTObject.Application.Version
then
branch to the appropriate code for that version?

"I am doing exactly the same thing and it works perfectly in certain cases
but if due any reason there exists office XP/2003 component on the system
but actually office 2000 is installed, the open method fails for office
2000. " (e.g Office 2000 installed on the system, upgraded to Office XP and
then uninstalled office XP for some reason, Office 2000 still installed)
 
S

Steve Rindsberg

"No we cannot pass literals to it sincethe methos expects the office
type.Tristate object as true or false."


"I am doing exactly the same thing and it works perfectly in certain cases
but if due any reason there exists office XP/2003 component on the system
but actually office 2000 is installed, the open method fails for office
2000. " (e.g Office 2000 installed on the system, upgraded to Office XP and
then uninstalled office XP for some reason, Office 2000 still installed)


I see. I'm afraid I've no way of testing it here. The only thing I can think of
is to try to trap any error when you open it the first way and if an error
occurred, try the other way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top