inter-presentation communication

  • Thread starter Thread starter barn2003
  • Start date Start date
B

barn2003

hi

If you've launched a hyperlinked presentation is there
any way to call a function or retrieve the value of a
variable from the presentation that launched it.
 
You can do in the following manner:
1. Create a function in the parent presentation that returns the value of
the variable.
Function GetVarValue()
GetVarValue=<VariableName>
End Function

2. Invoke that function from the hyperlinked presentation and it will return
the value.
MsgBox Application.Run("C:\Path\presentation1.ppt!module1.GetVarValue")
 
hi

If you've launched a hyperlinked presentation is there
any way to call a function or retrieve the value of a
variable from the presentation that launched it.

Yup.

Presentation2 has an action button that calls this macro:

Sub TestTheOtherGuy()
' Run the macro "TestMe" in Presentation1.PPT, also open
' and pass it a string
Call Application.Run("Presentation1!TestMe", "Badabing!")
End Sub

TestMe in Presentation1 can be anything you like:

Sub TestMe(sMsg As String)
MsgBox (sMsg)
End Sub

Or:

Sub WhatsMyName()
MsgBox (Application.Run("Presentation1!MyName"))
End Sub

(in Presentation1.PPT)
Function MyName() As String
' Return a variable value
Dim sTemp As String
sTemp = "Some Name"
MyName = sTemp
End Function


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Back
Top