Author Topic: remove "Page-1" on mouseover when saved as web page?  (Read 7988 times)

0 Members and 1 Guest are viewing this topic.

rdandy5875

  • Newbie
  • *
  • Posts: 4
remove "Page-1" on mouseover when saved as web page?
« on: November 03, 2010, 02:57:47 PM »
When I save my visio documents as a web page, there is a mouseover on the entire .htm page it creates that says "Page-1"

Can anyone help remove this? Post-Publish editing is just fine. I've looked through the page(s) and taken out the "Page-1" references I've found, but none of them seem to alleviate the problem.

Thanks, Randy

rdandy5875

  • Newbie
  • *
  • Posts: 4
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #1 on: November 03, 2010, 03:04:21 PM »
Nevermind I found it

I'm exporting in .GIF format, in the file folder there is a .htm file named "gif_1.htm"

remove the ALT= description:

Code: [Select]
<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="" name=RasterImage BORDER="0" USEMAP="#visImageMap">

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2795
    • Paul Herber's website
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #2 on: November 03, 2010, 05:12:14 PM »
Code: [Select]
<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="" name=RasterImage BORDER="0" USEMAP="#visImageMap">

That's not really the right way to do it, instead set the title to blank viz.

Code: [Select]
<IMG id="ConvertedImage" SRC="gif_1.gif" ALT="put the old alt text back here" title="" name=RasterImage BORDER="0" USEMAP="#visImageMap">
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

rdandy5875

  • Newbie
  • *
  • Posts: 4
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #3 on: November 04, 2010, 10:34:50 AM »
Thanks I will make the changes.

Hey Ken

  • Full Member
  • ***
  • Posts: 199
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #4 on: December 03, 2012, 03:00:15 PM »
Paul:

Pardon me for resurrecting a two-year-old thread, but this is exactly the situation I find myself in, and have not been able to locate any other mention of the problem anywhere else on the web.

You are correct when you suggest adding TITLE="".  It works superbly (even though it's a jpeg in jpg_1.htm rather than a gif in gif_1.htm).  I made the change and none of the shapes on the page exhibit any spurious hover text.  However, the Visio drawing that I save as a web page has over a hundred pages to it, and hence over a hundred htm files I'd need to diddle.  I've hacked at it and could not find any easy way out. 

For a lot more background on how I'm using hover text, check out http://visguy.com/vgforum/index.php?topic=4337.0.  For some additional info, the bad hover text occurs in IE 8 and 9, but not in Firefox 13, so I only need to diddle for IE.  It does not occur where I have a shape with a User.visEquivTitle cell or a hyperlink; I get the text I expect rather than the page name.  It's only the vanilla shapes and page backgrounds that give me problems.    Replacing 'var gParams = ParseParams (location.search); with var gParams = “” did no good either.

Always something,

   - Ken

Ken V. Krawchuk
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
On demand at http://PennsylvaniaProject.com

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2795
    • Paul Herber's website
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #5 on: December 03, 2012, 03:14:10 PM »
Have a look at Notepad++, this has a Replace feature that works in all files within a folder, and can do a search and replace with a regular expression.
A regex to replace title="xxxxx" with title="" shouldn't be too difficult (though please don't ask me!).
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Hey Ken

  • Full Member
  • ***
  • Posts: 199
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #6 on: December 04, 2012, 02:48:30 PM »
Paul:

   Thanks for the suggestion, but I was really hoping for a zero-effort solution, maybe something cutely esoteric along the lines of the visEquivTitle that I could sneak in somewhere somehow and have everything automagically work.  Unfortunately, using a gang editor like Notepad++ would add another step to my release process, something I had hoped I could avoid because I expect to be doing a lot of releases.  Still, it is a solution and a viable way to get around a minor user experience annoyance.  Maybe I'll put together a macro that'll generate the web version, then spin thru the html and make the changes with no additional effort on my part.  Can you tell I'm a firm believer that laziness is a virtue?

   As always, I appreciate the thought.

   - Ken
Ken V. Krawchuk
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
On demand at http://PennsylvaniaProject.com

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2795
    • Paul Herber's website
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #7 on: December 04, 2012, 02:51:40 PM »
Can you tell I'm a firm believer that laziness is a virtue?

Software is *all* about saving one key-stroke.
(but we ignore Cobol).
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2795
    • Paul Herber's website
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #8 on: December 04, 2012, 02:56:00 PM »
Have a look at Windows Power Shell, any file editing should be quite viable within a script. Might be able to create a script to loop through all your files, edit the HTML and save, might take just seconds.

Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

Hey Ken

  • Full Member
  • ***
  • Posts: 199
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #9 on: May 22, 2013, 08:55:06 AM »

   Maybe I'll put together a macro that'll generate the web version, then spin thru the html and make the changes with no additional effort on my part.  Can you tell I'm a firm believer that laziness is a virtue?


   Well, laziness notwithstanding, today is the day. 

   I had been using Notepad++ to do the gang editing (despite the hassle of the added step I sometimes forgot to do), but my latest client doesn't have it installed and it would take special papal dispensation to get it.  So I bit the bullet and took the VBA route.  Took a couple of twists and turns, but it wasn't all that difficult to develop.  One of the biggest twists was that I could not reference Visio's file system object (the security folks here have everything locked down tight), so I had to work around it using Addons("SaveAsWeb").Run. 

   So I finally have what I really wanted: a one-shot fire-and-forget solution to publish to html that eliminates all the annoying behavior.  Another nice upshot is that I now have a gang editor that can also be used in a variety of non-Visio situations.  I'll turn Visio into a full-blown operating system yet!  The code is below.

   - Ken


Code: [Select]

Public Sub BuildWebVersion()

Dim PathName           As String
Dim FileNames          As String
Dim InputFileName      As String
Dim OutputFileName     As String
Dim I                  As Integer
Dim AString            As String
Dim ThisFileName       As String
Dim ExecutableHtml     As String
Dim BrowserTitle       As String
Dim ActiveDocumentName As String

' Extract file name without extension (not always needed, though)
ActiveDocumentName = ActiveDocument.Name
If LCase(Right(ActiveDocumentName, 4)) = ".vsd" Then
    ActiveDocumentName = Left(ActiveDocumentName, Len(ActiveDocumentName) - 4)
    End If

PathName = ActiveDocument.Path
If PathName = "" Then
    MsgBox "Visio does not allow a web version to be created until after the document has been saved once.  Please save the file, then re-try publishing the web version.", vbCritical, "Web Options"
    Exit Sub
    End If
   
BrowserTitle = InputBox("Enter title for browser tab (blank to abort):", "Web Options", ActiveDocumentName)
If BrowserTitle = "" Then Exit Sub

' build full name of the executable html file
ExecutableHtml = PathName & ActiveDocumentName & ".htm"

Addons("SaveAsWeb").Run _
    " /Target=""" & ExecutableHtml & """" & _
    " /PageTitle=" & BrowserTitle & _
    " /Prop=False " & _
    " /Folder=True " & _
    " /StartPage=-1 " & _
    " /EndPage=-1 " & _
    " /OpenBrowser=false " & _
    " /PriFormat=jpg " & _
    " /ScreenRes=1024x768 " & _
    " /Quiet=true " & _
    " /Silent=false " & _
    " /Search=False " & _
    " /PanZoom=False " & _
    " /NavBar=false "

' Fix annoying behavior in the executable html file
Open ExecutableHtml For Input Shared As #3

' build name for temporary file to hold fixes
OutputFileName = Left(ExecutableHtml, InStr(1, ExecutableHtml, ".htm")) & "kvk"
Open OutputFileName For Output Shared As #4

Do While Not EOF(3)
    Line Input #3, AString
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Remove "undefined" hover text
    I = InStr(1, AString, "var gParams = ParseParams (location.search);")
    If I > 0 Then
        AString = "var gParams = """""
        End If
    ' Remove "Click to follow hyperlink." hover text
    I = InStr(1, AString, "var strHLTooltipText = ""Click to follow hyperlink."";")
    If I > 0 Then
        AString = "var strHLTooltipText = """";"
        End If
    ' Remove "This frame contains the pages of your drawing." hover text
    I = InStr(1, AString, "title=""This frame contains the pages of your drawing.""")
    If I > 0 Then
        AString = Left(AString, I - 2) & " " & Right(AString, Len(AString) - I - 54)
        End If
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Print #4, AString
    Loop

Close #3
Close #4
Kill ExecutableHtml
Name OutputFileName As ExecutableHtml

' fix annoying behavior in all of the individual browser pages
PathName = PathName & ActiveDocumentName & "_files\"
FileNames = PathName & "*.htm"
' Get first file
ThisFileName = Dir(FileNames)

Do While ThisFileName <> ""
    InputFileName = PathName & ThisFileName
    Open InputFileName For Input Shared As #1
    ' build name for temporary file to hold fixes
    OutputFileName = Left(InputFileName, InStr(1, InputFileName, ".htm")) & "kvk"
    Open OutputFileName For Output Shared As #2
   
    Do While Not EOF(1)
        Line Input #1, AString
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        ' Remove floating page name (only appears in IE)
        I = InStr(1, LCase(AString), "<img id=""convertedimage""") + 24
        If I > 24 Then
            AString = Left(AString, I) & "  title=""""  " & Right(AString, Len(AString) - I)
            End If
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Print #2, AString
        Loop
   
    Close #2
    Close #1
    Kill InputFileName
    Name OutputFileName As InputFileName
    ThisFileName = Dir ' sets up for next file, if there
    Loop

' Launch the html
ActiveDocument.FollowHyperlink ExecutableHtml, ActiveDocument.Pages.Item(1).Name

End Sub

« Last Edit: May 29, 2013, 08:42:15 AM by Hey Ken »
Ken V. Krawchuk
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
On demand at http://PennsylvaniaProject.com

Yacine

  • Hero Member
  • *****
  • Posts: 2632
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #10 on: September 01, 2016, 11:09:37 AM »
*****
Yacine

Hey Ken

  • Full Member
  • ***
  • Posts: 199
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: remove "Page-1" on mouseover when saved as web page?
« Reply #11 on: September 02, 2016, 08:05:27 AM »

   *****?
Ken V. Krawchuk
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
On demand at http://PennsylvaniaProject.com