Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activate windows.item in Office 2000?

Status
Not open for further replies.

Scrooby

Technical User
Feb 4, 2004
5
NL
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
 
Have you tried MsgBox env0 to see their value ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi,
Here's where I was wrong: I thought the file did not open altogether, but it actually DOES open. (I am myself using PPT 2003, but this thing I am creating also has to work in PPT 2000). However when my new file opens, the macros which I put in there don't work!
Can you help me a bit further?

Thanks, Huiberdien
 
What is the security level for macros ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Mmm, I thought it was obvious that macro settings could not be the trigger, as I had already put my settings to medium... However, my need to solve this problem exceeded my stubbornness, and indeed: when I put my macro settings to 'low security', the whole thing seems to work!

I am still a bit confused though: my macro settings in PPT 2003 are also set to medium, and still the macros work in the 2nd file, without PPT asking me if I want te enable them (which I would expect).

Thanks for reminding me!!

Huiberdien
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top