Hyperlink Subaddress (1 Viewer)

D

Dgar007

Guest
Hi,

I have a hyperlink that goes out to a powerpoint presentation. I use a subaddress to get to the slide I want depending on which record the user is on in the access97 db. This works fine as long as there is a slide for each record. If no slide exists it automatically brings up the first slide in the presentation. I would like to trap that error before it get to that point, but no error is raised. Has anyone encountered and resolved this issue before?

Here is a partial of the code:

Dim strInput As String
strInput = "h:\corporate\ApplicationRepository\AppRep.ppt" 'powerpoint 'presentation
Application.FollowHyperlink strInput, Me.SFTWNO, False 'slide within presentation corresponding to record
lblTest.ForeColor = vbRed 'changes color of label to red.

Thanks in advance,
 

Fornatian

Dim Person
Local time
Today, 16:24
Joined
Sep 1, 2000
Messages
1,396
Use an If function to determine of the textbox is null or not:

If Not IsNull(Me.SFTWNO) Then

Dim strInput As String
strInput = "h:\corporate\ApplicationRepository\AppRep.ppt" 'powerpoint 'presentation
Application.FollowHyperlink strInput, Me.SFTWNO, False 'slide within presentation corresponding to record
lblTest.ForeColor = vbRed 'changes color of label to red.

Else
'whatever you need to do if it is null
End if
 
D

Dgar007

Guest
Thanks, but Me.SFTWNO will always be a valid record. The problem is that Power Point may not have the record. When Power Point doesn't have the slide corresponding to the record, it will just display the first slide in the presentation.
 

Fornatian

Dim Person
Local time
Today, 16:24
Joined
Sep 1, 2000
Messages
1,396
If that's the case then IMHO there is no way for PPT to notify you that the bookmark doesn't exist unless you do some research into the PowerPoint object heirarchy, include that in VBA reference, get the file object, loop the slides and check the bookmark against existing bookmarks/slides.

My approach would be much simpler in that I would create another table with the powerpoint bookmarks stored, join it to the existing forms field recordset using a left join from the form records. Add this field to the form. Then when the newly added field is blank, the slide doesn't exist.

I know it's not self-updating, but hey, this is free advice you know :D
 
D

Dgar007

Guest
Thanks, Looked over the info...I guess the best way to handle is with an API call to check PP once I have it opened and send back boolean to Access. Does this sound feasible? I am not API savvy and it will take me some time to get it working correctly, but at least I have some type of guidance.

Thanks for the info,
 

Fizzio

Chief Torturer
Local time
Today, 16:24
Joined
Feb 21, 2002
Messages
1,885
Too much time rather than patients on my hands obviously!:p
 
D

Dgar007

Guest
Could never find a way to get a return value from PP, so I cheated...the first slide is a slide that says "NO SLIDE EXISTS FOR THIS RECORD". It works, but is not the most ideal way I would have liked.

Thanks for everyone's help.
 

Users who are viewing this thread

Top Bottom