Hi Shyam,
I am trying to combine the 2 scripts to form one that opens a pps in edit
mode as well as enters tht epassword but there seems to be a problem I can't
find.
I usually write in php and Lingo, and a bit in ActionScript so VB is
completely new to me...
Here is the script:
*********************************************
Option Explicit
Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public sPwd As String
Sub OpenPassPres()
On Error GoTo ErrHandle
Dim pShow As Presentation
TimerID = SetTimer(0, 0, 2000, AddressOf PassProc)
' Lock the window to prevent refreshing
ScreenUpdating = False
' your password
sPwd = "marple"
'Open the show, however use additional flag - WithWindow set to FALSE
Set pShow =
Presentations.Open("C:\WorkFolder\TrainingModuleSystem\Xtras_stuff\ActiveCompanion_Xtra\PPA_Test\OurApproachPowerPoint.pps", WithWindow:=msoFalse)
'Open a window now to the presentation for editing
pShow.NewWindow
' Unlock the window to start refreshing again
ScreenUpdating = True
Exit Sub
ErrHandle:
If Err.Number <> 0 Then
MsgBox Err.Number & " " & Err.Description, _
vbCritical + vbOKOnly, "Error"
End If
End Sub
Sub PassProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal idEvent As Long, _
ByVal dwTime As Long)
TimerID = KillTimer(0, TimerID)
SendKeys sPwd & "~"
End Sub
******************************************
Is it a problem easily spotted?
Thx if you can help me!!!!
NC
Shyam Pillai said:
Nik,
How to open a PowerPoint Show (*.pps) programatically.
http://skp.mvps.org/ppt00033.htm#VBAPPSOpen