Is it possible to open powerpoint from a slideshow macro?

  • Thread starter Thread starter yanwei
  • Start date Start date
Y

yanwei

Hi

I want to beable to start powerpoint up from a powerpoint slideshow,
ie from a .pps file and open the current file (on display in the
slideshow) in powerpoint, ie where i can edit the file.

Is this possible? if so how?

thanks.
yanwei
 
Rename the file to give it an extension of .PPT and it will open in edit mode
when you double click it, or open PowerPoint and then go to File > Open. Locate
the file and open it.
--

Sonia Coleman
Microsoft PowerPoint MVP Team
Autorun Software, Templates and Tutorials
http://www.soniacoleman.com
 
Hi sonia

Thanks for the reply. Sorry I wasn't very clear with my question
before. What I have at the moment is:

- I have a .pps file open, it's in slideshow mode
- Powerpoint is NOT currently open/running
- The .pps file has a macro

What I want to do is:

1. There is a textbox that will let the user activate the macro by
clicking on it.
2. The macro will change the file.
3. Instead of saving the file, I want to open the modified file using
PowerPoint for editing purposes.

Is this possible?

If not, I am happy to first save the file after modification as a .ppt
file. Can I then open the file using macro for editing in PowerPoint?
Please keep in mind that Powerpoint is not running and I am only
running slideshow (ie. the .pps file).

While I am at it, is there an easier way to get a "Save As" window up
like the ones in MS programs (can look up folders and things, not a
inputbox) without doing my own userform in PowerPoint?

Currently using PowerPoint 2000, MS PowerPoint 9.0 object lib, MS
office 9.0 object lib and ActiveX data object 2.6 lib.

Thanks so much
Yanwei
 
It sounds like you'll need some VBA, which I don't speak. Others will have to
help you there.

How are you running the slide show if not in PowerPoint?
 
Hi sonia

Thanks for the reply. Sorry I wasn't very clear with my question
before. What I have at the moment is:

- I have a .pps file open, it's in slideshow mode
- Powerpoint is NOT currently open/running
- The .pps file has a macro

Either you have PowerPoint or the viewer running. Nothing else can display the
presentation. If it's the viewer, then macros won't work; the viewer doesn't
support them.

As far as the rest, I'm not sure you can do it, even with VBA. But it sounds like
this is a possible solution to a problem, not the problem itself. Maybe there are
other solutions; what's the problem you need to solve?
 
Hi Steve

Yes, I have the viewer open NOT PowerPoint. It's just like I have
double clicked on a .pps file on the desktop. I am using VBA(macro). I
want to know if it's possible to use VBA (macro) to open PowerPoint to
edit the current file that is in the viewer.

If it's possible, what do I need to do. I guess this is the most
important part. :)

Yanwei

 
Steve wasn't kidding. The Viewer does not support macros, VBA, or ActiveX
controls.

yanwei said:
Hi Steve

Yes, I have the viewer open NOT PowerPoint. It's just like I have
double clicked on a .pps file on the desktop. I am using VBA(macro). I
want to know if it's possible to use VBA (macro) to open PowerPoint to
edit the current file that is in the viewer.

If it's possible, what do I need to do. I guess this is the most
important part. :)

Yanwei
 
What Steve and Sonia said and ...

Just because it is a .pps file, doesn't mean it necessarily has to open
in the Viewer. You can adjust your registry to have it open in the
regular PowerPoint (assuming you have regular PowerPoint). From there,
you might be able to run a macro to do what you want, but I'm not sure.
Maybe you can adjust your registry to open a .pps in Edit mode. Then, all
you have to do to return to Edit mode is a link to End Show. These are
just some thoughts, but I don't think any of us are completely clear on
what you want to do.

--David

--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

Steve wasn't kidding. The Viewer does not support macros, VBA, or
ActiveX controls.
 
Yanwei said:
Hi Steve

Yes, I have the viewer open NOT PowerPoint. It's just like I have
double clicked on a .pps file on the desktop. I am using VBA(macro). I
want to know if it's possible to use VBA (macro) to open PowerPoint to
edit the current file that is in the viewer.

No. The viewer does not support VBA, so you can't use macros.
If it's possible, what do I need to do. I guess this is the most
important part. :)

Yanwei
 
Hi Steve

Sorry that i can't ask the question clear enough. But I managed to get
powerpoint to open. But can't open the file i need.

You said that the viewer does not support VBA, but I still got macro to
work when I am in slideshow mode (and the powerpoint program is not
running). Does that mean that I am not just in the viewer? Basically
just clicking on a .pps file.

I know I can change the registry, but the .pps file will be used on
someone else's computer where I can't and won't be allowed to change
the registry settings. :)

Thanks
Yanwei
 
You said that the viewer does not support VBA, but I still got macro to
work when I am in slideshow mode (and the powerpoint program is not
running).

No, sorry. You didn't. You may have gotten the macro to work while you were
viewing the presentation in PowerPoint's slide show view, though.
Does that mean that I am not just in the viewer? Basically
just clicking on a .pps file.

Right. Not in the viewer. If both the viewer and PowerPoint are installed,
PowerPoint wins. When you doubleclick a PPS, PPT starts up and goes
immediately into slideshow view; it exits when the show ends. You never see
PowerPoint itself, which is why it seems that you're using the viewer.
I know I can change the registry, but the .pps file will be used on
someone else's computer where I can't and won't be allowed to change
the registry settings. :)

Will they have PowerPoint or will they have the Viewer? Again, if all they
have is the viewer, your macros won't work.
 
Hi Steve

They will. The main reason I want to open the current modified file in
PowerPoint is so that they can edit the new file.

I am sorry for all this trouble and not asking clear questions as I
don't know how they work. Though I am learning. :) Thanks for your
patience.

Many Thanks
Yanwei
 
Yanwei said:
Hi Steve

They will. The main reason I want to open the current modified file in
PowerPoint is so that they can edit the new file.

Again, what is the problem this is trying to solve?
Why don't they just open and save the file, for example, since they have
PowerPoint?
 
Hi Steve

This goes back to the problem that PowerPoint does not autorun macros.
To get macros running, either have to have addins (which I can't get
them to do), or run it by going to tools -> macros -> run (which may be
too complicated) and the last option is to have a button like thing to
run the macro in slideshow mode. This is what I am trying to do. When
they double click on the file, slideshow will run, and then click on
the text box to run the macro. After the macro changed the file, open
it in powerpoint to edit the file. This is what I am trying to do.

Does it make sense? Is there an easier way to do it? Am I making
something simple very complicated? ^-^

Thanks
Yanwei
 
This goes back to the problem that PowerPoint does not autorun macros.
To get macros running, either have to have addins (which I can't get
them to do), or run it by going to tools -> macros -> run (which may be
too complicated) and the last option is to have a button like thing to
run the macro in slideshow mode. This is what I am trying to do. When
they double click on the file, slideshow will run, and then click on
the text box to run the macro. After the macro changed the file, open
it in powerpoint to edit the file. This is what I am trying to do.

Does it make sense? Is there an easier way to do it? Am I making
something simple very complicated? ^-^

Hmm. By refusing to let you use an addin, it sounds like your client is
forcing you to do it the hard way.

So what if your macro does a Save As and saves the current presentation to a
new file and opens that?
 
Hi Steve

Thanks thats what I was thinking of doing if I couldn't get my open it
directly.

Thanks again.Do I need to start a new posting about text overflow? I
want to keep the text, and if there is more text than the box can hold,
can I keep the text but only show the part that can be appear within
the boundaries of the textbox?

Many thanks again.
Yanwei
 
Thanks again.Do I need to start a new posting about text overflow? I
want to keep the text, and if there is more text than the box can hold,
can I keep the text but only show the part that can be appear within
the boundaries of the textbox?

A new posting might be a good idea; that way you can post with a new
title/subject line. But if you like, just copy/paste from this message to save
some typing.

You could add a tag to the shape and set the value of the tag to the shape's
text. That'd store the original text nicely.
 
Hi Steve

Since I saved that file, is it possible to get rid of it after I opened
it? Here is my code:

ActivePresentation.SaveAs "~tmp", ppSaveAsPresentation
With PowerPoint.Presentations.Open("~tmp.ppt", msoFalse, msoTrue,
msoFalse)
.Application.Visible = msoTrue
.Saved = msoFalse
End With
PowerPoint.Presentations(1).Close

I have set it up so the user will get a SaveAs window when ever they
want to save, so they can't save to the file that I created.

The macro will only be active if the orignal (Presentations(1)) is
still open. The new file "~tmp.ppt" will have the macro, but it will
not run until activeated. So is it possible to delete the "~tmp.ppt"
file that I created, before the presentations(1) is closed? I tried
the following:

FileSystem.Kill ActivePresentation.Path & "~tmp.ppt"

but as expected, I was not allowed to do it, got error of permission
denied.

My assumption/guess is I can't do it, but I am trying my luck. If it is
not possible to do it before it's closed, is there a way to get ride of
it at all (err. i don't mean by the user. :) )?


Thanks
Yanwei
 
Hi Steve

Please ignored that last question. I found out that the macro does not
end at the point when I close the presentation. So I was able to delete
the file after I close the presentation. I am now very very happy. :)

Thanks for your help.
Yanwei
 
Hmm. I see the problem ... you can't close the presentation the macro's
running in while the macro's running.

But you know the new presentation will have the same macros in it as the one
you're closing, so what if the macro (running in the original presentation)
calls another subroutine (in the NEW presentation).

The new subroutine closes the original file then does whatever you want to do
next.

Can you arrange to have your customer sent on a four or five year vacation to
Antarctica instead? ;-)
 

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

Back
Top