Need a "BACK" functionality (Button/Link/Command/Macro)

A

Andrew

Example: A Visio (2003) document with 100 pages. There are hyperlinks on 10
of the pages that link to either a shape on the "ORDER" page or to the page
itself. Therefore it is easy to navigate TO the "ORDER" page. But when
presenting, the viewers will sometimes want to take a quick peek back at what
got them there. That is, not following the document's flow.

I need a "BACK" button/link/command/macro.

Is there a way to just go "BACK" to the previous page that was viewed?

Thank you in advance,
Andrew
 
J

John Goldsmith_Visio_MVP

Hello Andrew,

This sounds like Off Page Reference shapes might help here (see File /
Shapes / Flowcharts / Basic Flowchart Shapes) as these include the option of
adding a 'return shape' on the target page.

If you're just using standard hyperlinks (Ctrl + K) to shapes then you might
want to have a look at the web toolbar, which includes back / forward
functionality (see View / Toolbars / Web)

Hope that helps.

Best regards

John


John Goldsmith (Visio MVP)
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 
P

Paul Herber

Example: A Visio (2003) document with 100 pages. There are hyperlinks on 10
of the pages that link to either a shape on the "ORDER" page or to the page
itself. Therefore it is easy to navigate TO the "ORDER" page. But when
presenting, the viewers will sometimes want to take a quick peek back at what
got them there. That is, not following the document's flow.

I need a "BACK" button/link/command/macro.

Is there a way to just go "BACK" to the previous page that was viewed?

menu View -> Toolbars - Web
This toolbar contains Back and Forward buttons.Customizing the toolbars can give you these
buttons on the Standard or any other toolbar.
 
A

Andrew

Thank you guys. Both tips are very helpful and just what I needed.

One question however. Every time I try to use the forward or back buttons,
in the Web toolbar, I get a warning "Hyperlinks can be harmful..." and
prompted to allow them or not. That makes the buttons essentially useless.
How can I turn off the warning?

Thanks again,
Andrew
 
A

Andrew

Well, I found this (http://support.microsoft.com/default.aspx/kb/829072)
knowledge base article, which allows me to disable the nag. That helps a
lot. I can display the 'web' toolbar and use it to navigate forwards and
back when I am in 'normal view'. Howevever, when I am in Full Screen
(presentation) view, the ALT+Left and ALT+Right hotkeys do not work and of
course then toolbar isn't visible to use.

Is there any keyboard or mouse commands that can be used for Forward and
Back when in Full Screen view?

Thanks in advance,
Andrew
 
A

Andrew

I'm trying to use a macro that will perform the functionality of the 'back'
button. However, I'm not very handy with VBA. Any help will be appreciated.

In the "Visio Objects" for "ThisDocument" I have put the following, which is
intended to provide a value for the last page visited.
Private Sub Page_Activate()
LastPage = WhatPage
WhatPage = ActiveWindow.Page
End Sub

In the Modules / NewMacros I put the following to be the working macro.
Global WhatPage As String, LastPage As String
Sub GoBack()
' Keyboard Shortcut: Ctrl+Shift+B
Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)
End Sub

But nothing happens. Please advise on where I'm going wrong.

Thanks in advance,
Andrew
 
P

Paul Herber

I'm trying to use a macro that will perform the functionality of the 'back'
button. However, I'm not very handy with VBA. Any help will be appreciated.

In the "Visio Objects" for "ThisDocument" I have put the following, which is
intended to provide a value for the last page visited.
Private Sub Page_Activate()
LastPage = WhatPage
WhatPage = ActiveWindow.Page
End Sub

At the very least you need to change:

Private Sub Page_Activate()
LastPage = ActiveWindow.Page
End Sub
 
A

Andrew

I'm not following you Paul.

I believe ActiveWindow.Page is the current page, not the last page.
Therefore WhatPage = ActiveWindow.Page. When the user goes to a new page
then LastPage is set to WhatPage, that is the previous page. When the macro
is run then the user is sent back to LastPage.

However, I did try your suggestion.

When running the GoBack() macro, I still receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the line "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highlighed in yellow.

I'm thinking this line of code is the first that needs to be put in the
correct syntax. But I don't have a clue on what needs to change.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error...
Run-time error -2032465758 (86db08a2)
Invalid container identifier.
And the GoBack macro line of
Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)
is highligted in yellow.

I am thinking I need to get the syntax of this line corrected first, but I
do not have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error 2032465758 (86db08a2) Invalid container identifier.
And the primary line of the GoBack macro is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I receive
the same error, on the GoBack macro.

I get: Run-time error 2032465758 (86db08a2), Invalid container identfier,
and the main line of the GoBack macro is highlighted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
A

Andrew

I'm not following you Paul.

WhatPage is the current page. When a user goes to a new page then LastPage
becomes the previous WhatPage. Then when the GoBack macro is run, then user
is taken back to LastPage. However, I did try your suggestion. I received
the same error, on the GoBack macro.

When I run the GoBack macro, I receive the following error:
Run-time error '-2032465758 (86db08a2)':
Invalid container identifier.
And the GoBack macro line of "Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU(LastPage)" is highligted in yellow.

I'm thinking I need to get the syntax of this line corrected first, but I
don't have a clue as to what it should be.

Thanks again,
Andrew
 
D

David J Parker [MVP Visio]

Try this in the ThisDocument class

Option Explicit
Private WithEvents mwin As Visio.Window

Private LastPage As String

Public Sub StartListening()
Set mwin = Visio.ActiveWindow
End Sub

Public Sub GoBack()
Dim pageName As String
If Len(LastPage) > 0 Then
pageName = Visio.ActivePage.NameU
Visio.ActiveWindow.Page = LastPage
LastPage = pageName
End If
End Sub

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
StartListening
End Sub

Private Sub mwin_BeforeWindowPageTurn(ByVal Window As IVWindow)
LastPage = Window.Page.NameU
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top