Run a macro in PowerPoint with Action Settings

G

Guest

I cannot get the macros to run in a PowerPoint 2002 slideshow using the
Action Settings options for Mouse Click, even after I have changed the
Security to Medium or Low. The macros do run from the Tools menu, but now
within the Slideshow. (The Run program, and Hyperlink to, etc. work, but not
the macros). Please help. I need this soon. Thanks
 
G

Guest

Almost certainly you have written / recorded a macro that wont run in slide
show mode (The object model is quite different)

Either post up your macro code or what you want to achieve.
--
 
M

Mr . .

What is the difference between VB code for a macro that runs in a .ppt and a
powerpoint show?

I have similar issue with action setttings not triggering the macro.
Jo
 
M

Mr . .

That makes sense. I'll need to modify the code abit. How about getting the
app to close after the email marco runs? That way the user can click the
'yes' to allow outlook to send the email.

any suggestions on code?

Jo

Public Sub SendMail(ByVal mail_to As String, Optional ByVal _
mail_cc As String = "", Optional ByVal mail_bcc As _
String = "", Optional ByVal mail_subject As String, _
Optional ByVal mail_body As String = "")
Dim strParameters As String
Dim strCommand As String

' Compose the parameters.
If Len(mail_cc) Then strParameters = strParameters & _
"&CC=" & ReplaceSpecialCharacters(mail_cc)
If Len(mail_bcc) Then strParameters = strParameters & _
"&BCC=" & ReplaceSpecialCharacters(mail_bcc)
If Len(mail_subject) Then strParameters = strParameters _
& "&Subject=" & _
ReplaceSpecialCharacters(mail_subject)
If Len(mail_body) Then strParameters = strParameters & _
"&Body=" & ReplaceSpecialCharacters(mail_body)

' If the parameters aren't blank,
' replace the initial & with ?.
If Len(strParameters) Then Mid(strParameters, 1, 1) = _
"?"

' Add the basic mailto command.
strCommand = "mailto:" & mail_to & strParameters

' Send this to ShellExecute.
ShellExecute Me.hwnd, "open", strCommand, _
vbNullString, vbNullString, SW_SHOWNORMAL
End Sub

 
S

Steve Rindsberg

That makes sense. I'll need to modify the code abit. How about getting the
app to close after the email marco runs? That way the user can click the
'yes' to allow outlook to send the email.

To get PowerPoint to close:

' First either save the active presentation or
' Let the user save them when PPT asks or
' Force the issue with:
ActivePresentation.Saved = True
Application.Quit

Add this right after ShellExecute
any suggestions on code?

Jo

Public Sub SendMail(ByVal mail_to As String, Optional ByVal _
mail_cc As String = "", Optional ByVal mail_bcc As _
String = "", Optional ByVal mail_subject As String, _
Optional ByVal mail_body As String = "")
Dim strParameters As String
Dim strCommand As String

' Compose the parameters.
If Len(mail_cc) Then strParameters = strParameters & _
"&CC=" & ReplaceSpecialCharacters(mail_cc)
If Len(mail_bcc) Then strParameters = strParameters & _
"&BCC=" & ReplaceSpecialCharacters(mail_bcc)
If Len(mail_subject) Then strParameters = strParameters _
& "&Subject=" & _
ReplaceSpecialCharacters(mail_subject)
If Len(mail_body) Then strParameters = strParameters & _
"&Body=" & ReplaceSpecialCharacters(mail_body)

' If the parameters aren't blank,
' replace the initial & with ?.
If Len(strParameters) Then Mid(strParameters, 1, 1) = _
"?"

' Add the basic mailto command.
strCommand = "mailto:" & mail_to & strParameters

' Send this to ShellExecute.
ShellExecute Me.hwnd, "open", strCommand, _
vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
 
G

Guest

My ultimate goal is to add the contents of two text boxes together during the
slideshow, but in order to text the Run Action, I simply recorded a macro to
change the color of the text box. That macro does not run in slideshow. Any
suggestions?

Thanks, John
 
M

Mr . .

Another poster put this up:

Macros I record in Normal/Slide view don't work in Slide Show
http://www.rdpslides.com/pptfaq/FAQ00159.htm

It seems that a macro needs to be tailored to run in slideshow mode. I
believe the link above may provide some hints on how the code for slideshow
differs from a regular presentation.

Jo
 
S

Steve Rindsberg

Another poster put this up:

Macros I record in Normal/Slide view don't work in Slide Show
http://www.rdpslides.com/pptfaq/FAQ00159.htm

It seems that a macro needs to be tailored to run in slideshow mode. I
believe the link above may provide some hints on how the code for slideshow
differs from a regular presentation.

That's correct.

The main thing to remember is that most macro-recorded code works with the
current selection. Since you can't select anything in slide show view, such
code won't work.
 
M

Mr . .

I have this snippet of code to close .ppt in my macro but it is not closing
the powerpoint show. What changes should be made?

' Get a reference to the PowerPoint Application
object. Set appPowerPoint = CreateObject("PowerPoint.Application")
' Close the presentation.
appPowerPoint.ActivePresentation.Close
' Quit PowerPoint.
appPowerPoint.Quit
' Close the object variable.
Set appPowerPoint = Nothing



Steve Rindsberg said:
That makes sense. I'll need to modify the code abit. How about getting the
app to close after the email marco runs? That way the user can click the
'yes' to allow outlook to send the email.

To get PowerPoint to close:

' First either save the active presentation or
' Let the user save them when PPT asks or
' Force the issue with:
ActivePresentation.Saved = True
Application.Quit

Add this right after ShellExecute
 
S

Steve Rindsberg

I have this snippet of code to close .ppt in my macro but it is not closing
the powerpoint show. What changes should be made?

Do a search in this newsgroup for "Howard Kaikow"

Howard researched this quite thoroughly and posted his results here.

What you get depends somewhat on the version of PPT you're automating, as I
recall.


' Get a reference to the PowerPoint Application
object. Set appPowerPoint = CreateObject("PowerPoint.Application")
' Close the presentation.
appPowerPoint.ActivePresentation.Close
' Quit PowerPoint.
appPowerPoint.Quit
' Close the object variable.
Set appPowerPoint = Nothing
 

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