Hi,
I am trying to activate a specific file from another file. The code below works fine in all kinds of ppt-versions, but not in ppt 2000 (it then opens a new presentation, instead of referring to the old one)!! Does anybody know how we can get ppt 2000 to activate a window?
Thanks to the one who can help!!!
Huiberdien
Private Sub CommandButton1_Click()
UserForm0_1.Hide
Dim env0, env1, env2, env3, env4, env5, env6, env7
On Error Resume Next
env0 = Windows.Item(Index:=0)
env1 = Windows.Item(Index:=1)
env2 = Windows.Item(Index:=2)
env3 = Windows.Item(Index:=3)
env4 = Windows.Item(Index:=4)
env5 = Windows.Item(Index:=5)
env6 = Windows.Item(Index:=6)
env7 = Windows.Item(Index:=7)
On Error Resume Next
'this part below, we repeat several times, in order to cover all windows.items
If env0 = "environment" Then
Windows.Item(Index:=0).Activate
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
Else: GoTo eerstetest
End If
Exit Sub
eerstetest:
If env0 = "environment.ppt" Then
Windows.Item(Index:=0).Activate
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
Else: GoTo tweedetest
End If
Exit Sub
tweedetest:
Presentations.Open FileName:=ActivePresentation.Path & "\environment.ppt"
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
End Sub
I am trying to activate a specific file from another file. The code below works fine in all kinds of ppt-versions, but not in ppt 2000 (it then opens a new presentation, instead of referring to the old one)!! Does anybody know how we can get ppt 2000 to activate a window?
Thanks to the one who can help!!!
Huiberdien
Private Sub CommandButton1_Click()
UserForm0_1.Hide
Dim env0, env1, env2, env3, env4, env5, env6, env7
On Error Resume Next
env0 = Windows.Item(Index:=0)
env1 = Windows.Item(Index:=1)
env2 = Windows.Item(Index:=2)
env3 = Windows.Item(Index:=3)
env4 = Windows.Item(Index:=4)
env5 = Windows.Item(Index:=5)
env6 = Windows.Item(Index:=6)
env7 = Windows.Item(Index:=7)
On Error Resume Next
'this part below, we repeat several times, in order to cover all windows.items
If env0 = "environment" Then
Windows.Item(Index:=0).Activate
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
Else: GoTo eerstetest
End If
Exit Sub
eerstetest:
If env0 = "environment.ppt" Then
Windows.Item(Index:=0).Activate
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
Else: GoTo tweedetest
End If
Exit Sub
tweedetest:
Presentations.Open FileName:=ActivePresentation.Path & "\environment.ppt"
With ActivePresentation.SlideShowSettings.Run.View
.PointerType = ppSlideShowPointerArrow
.GotoSlide 1
End With
End Sub