C# Code - Can't Save After Open

S

Steve B.

Can someone tell me why when my ppt presentation opens and I try to save my
work to the original ppt presentation a Save As window pops up? Happens on
all ppt presentations. I've tried readOnly parameter both as msoTrue and
msoFalse - same result.

Steve

***************************
some Method()
{
Microsoft.Office.Core.MsoTriState readOnly = ...msoFalse;
pptFileName = "fileName.ppt"; //global for ppt events
openPowerPointPresentation(readOnly);
}

openPowerPointPresentation(....MsoTriState readOnly)
{
Microsoft.Office.Interop.PowerPoint.Application objApp = null;
objApp = new Microsoft.Office.Interop.PowerPoint.Application();

objApp.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;

//I've tried true/false on both
....MsoTriState untitled = ...msoTrue;
....MsoTriState withWindow = ...msoTrue;

....Presentation objPres = null;
objPres = objApp.Presentations.Open(this.pptFileName, readOnly, untitled,
withWindow);

objApp.Activate();
}
 
S

Steve B.

Sorry Steve - no Bingo

What your describing is the purpose/function of the Save As window.

The term readOnly is only a variable name having a MsoTriState boolean value
type of either true or false. If the readOnly variable equals false (e.g.
msoFalse) in the Open() method it is my understanding that it should not
bring up the Save As window (i.e. it's not a readOnly presentation) when you
try to save your changes BUT....it does. Why?

Steve
 
S

Steve B.

Steve: thanks for your help.

Shyam:

What's save code? (hmm - that's what I mean..I'm lost).

I started playing around with ppt events in Visual Studio but didn't
understand where I was going with it (that's why my pptFileName is global).

Goal: I'd like to think my requirements are that users that use my local
intranet application (e.g. getter program) have the ablity to link to an
existing network ppt/Excel/Word/Outlook file, open it, and manipulate the
file using the controls within the particular MS-Office product. As stated,
I do the same thing with Excel and Word but don't have a problem
there...sometimes.

Can you provide a example of save code?

Steve
 
S

Shyam Pillai

Steve,
You posted:
I try to save my work to the original ppt presentation a Save As window pops
up? Happens on all ppt presentations.

Where is the segment code which causes the Saves As to popup? All you've
posted is a bit used to open the presentation.

--
Regards,
Shyam Pillai

Handout Wizard: http://skp.mvps.org/how
 
S

Steve B.

Shyam

That's the problem, I don't have any other code that causes the Saves As to
popup. All the ppt code I have is the code I posted in the previous post to
open the application. Do I need more code? What code should I use to
properly close the application?

Steve
 

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