Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function GoBack(strBar As String, strButton As String, intCount As Integer)
' Procedure:    GoBack
' Description:  Return to a previous hyperlink page.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING names of command bar and button, INTEGER count of pages to go back
' Returns:      None
' Assumes:      Nothing
' Side Effects:
' Tested:       By the calls listed below.
    Dim iButton As Integer
    For iButton = 1 To CommandBars(strBar).Controls.Count
        Debug.Print CommandBars(strBar).Controls(iButton).DescriptionText
        If strButton = CommandBars(strBar).Controls(iButton).DescriptionText Then
            Dim i As Integer
            For i = 1 To intCount
                On Error GoTo ExitFor
                CommandBars(strBar).Controls(iButton).Execute
            Next i
        Else
        End If
    Next iButton
ExitFor:
'Sub TESTGoBack()
'Call GoBack("standard", "Backward hyperlink", 2)
'End Sub
'
'Sub TestObjectDocumentTheory()
'    Dim obj As Document
'    Set obj = ActiveDocument
'    MsgBox ActiveDocument.FullName ' my starting point.
'    Selection.Hyperlinks(1).Follow ' assumes I am on a {Hyperlink}.
'    MsgBox ActiveDocument.FullName ' jumped to hyperlinked document.
'    obj.Activate
'    MsgBox ActiveDocument.FullName ' my starting point ?????
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function GoBack(strBar As String, strButton As String, intCount As Integer)
' Procedure:    GoBack
' Description:  Return to a previous hyperlink page.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING names of command bar and button, INTEGER count of pages to go back
' Returns:      None
' Assumes:      Nothing
' Side Effects:
' Tested:       By the calls listed below.
    Dim iButton As Integer
    For iButton = 1 To CommandBars(strBar).Controls.Count
        Debug.Print CommandBars(strBar).Controls(iButton).DescriptionText
        If strButton = CommandBars(strBar).Controls(iButton).DescriptionText Then
            Dim i As Integer
            For i = 1 To intCount
                On Error GoTo ExitFor
                CommandBars(strBar).Controls(iButton).Execute
            Next i
        Else
        End If
    Next iButton
ExitFor:
'Sub TESTGoBack()
'Call GoBack("standard", "Backward hyperlink", 2)
'End Sub
'
'Sub TestObjectDocumentTheory()
'    Dim obj As Document
'    Set obj = ActiveDocument
'    MsgBox ActiveDocument.FullName ' my starting point.
'    Selection.Hyperlinks(1).Follow ' assumes I am on a {Hyperlink}.
'    MsgBox ActiveDocument.FullName ' jumped to hyperlinked document.
'    obj.Activate
'    MsgBox ActiveDocument.FullName ' my starting point ?????
'End Sub
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1