Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Powerpoint for Mac > Macro Based hyp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 2676 of 2860
Post > Topic >>

Macro Based hyperlink for Contents page

by =?Utf-8?B?emFrZmFsbHM=?= <zakfalls@[EMAIL PROTECTED] > Apr 15, 2008 at 02:33 AM

Hi,

i have ben trying to set-up a contents page which will update
automatiaclly 
whenever a slide is added or removed.

the only i have found of doing this is using a macro linked to the 
hyperlinks (unfortunately, i can't find the the post where i got this
answer 
from).

it works when you have slide number in the following format <xx> as a 
hyperlink to the relavent slide and the macro updates the new position of
the 
slide when a slide is removed or added. the macro coding is as follows:

Sub contents ()

Dim ohl As Hyperlink
Dim newtxt As TextRange
Dim Ipos1 As Integer
Dim Ipos2 As Integer
Dim InewID As Integer
Dim InewIndex As Integer
For Each osld In ActivePresentation.Slides
For Each ohl In osld.Hyperlinks
If TypeName(ohl.Parent.Parent) = "TextRange" Then
InewID = Left$(ohl.SubAddress, 3)
InewIndex =
ActivePresentation.Slides.FindBySlideID(CInt(InewID)).SlideIndex
Ipos1 = InStr(1, ohl.TextToDisplay, "<")
Ipos2 = InStr(1, ohl.TextToDisplay, ">")
If Ipos1 <> 0 And Ipos2 <> 0 Then
ohl.TextToDisplay = Left$(ohl.TextToDisplay, Ipos1 - 1) & _
"<" & CStr(InewIndex) & ">" & Right$ _
(ohl.TextToDisplay, Len(ohl.TextToDisplay) - Ipos2)
End If
End If
Next ohl
Next osld
Exit Sub
errhandler:
MsgBox "**ERROR**" & vbCrLf & "Error is " & Err.Description
End Sub

this works perfectly, however, if i send the presentation to someone else 
with the same software, they are able to see the macro, but cannot click
on 
the "Run" button in Macro tool bar.

any ideas as to why this is happening and is there any way around it?

Thanks
 




 5 Posts in Topic:
Macro Based hyperlink for Contents page
=?Utf-8?B?emFrZmFsbHM=?=   2008-04-15 02:33:01 
Re: Macro Based hyperlink for Contents page
"David M. Marcovitz&  2008-04-15 06:32:42 
Re: Macro Based hyperlink for Contents page
=?Utf-8?B?emFrZmFsbHM=?=   2008-04-15 07:59:03 
Re: Macro Based hyperlink for Contents page
"David M. Marcovitz&  2008-04-15 09:33:39 
Re: Macro Based hyperlink for Contents page
=?Utf-8?B?emFrZmFsbHM=?=   2008-04-15 11:11:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 19:09:34 CDT 2008.