• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2790
  • Last Modified:

Visio 2010 - Export Diagram and save Screen Tips

When I export my VISIO diagram the srcreen tips disappear.

When I put the cursor over the area when it is in visio the screen tips are there.

I have tried exporting to a few different formats but the screen tips disappear.

Is there a way I can export the screen tips as well?

Thanks
0
nickmark
Asked:
nickmark
  • 2
  • 2
1 Solution
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
Screen tips in Visio-generated web pages are created from a different shape field than screen tips in Visio itself. And the technique for making them appear is a bit on the tech-y side, but is well documented in this blog post from the Visio product team.

Be sure to notice the comments at the bottom: you can put a formula (=Comment) into the User.visEquivTitle field so that it automatically reflects the same text that's in the Visio screen tip.
0
 
Visio_GuyCommented:
Hi Nick, thanks Scott,

I've written some VBA macro code to make the process easier, if not less-techy.

Paste this code in the ThisDocument module of any document's VBA project, then run the first procedure. It will do what Scott's suggestion says to do to any shape that has a comment. You can run the second procedure to remove the stuff that the code adds.

Option Explicit

Const UserCellName$ = "User.visEquivTitle"
Const UserRowName$ = "visEquivTitle"

Const DummyShapeDataCellName$ = "Prop.visEquivTitle"
Const DummyShapeDataRowName$ = "visEquivTitle"

Public Sub SetScreenTipsForWebExport()
    
  '// This adds the functionality to show Screen Tips
  '// in exported web pages to each shape on the
  '// active page that has a non-blank screen tip.
  
  Dim pg As Visio.Page
  Set pg = Visio.ActivePage
  
  Dim st As String
  Dim shp As Visio.Shape
  For Each shp In pg.Shapes
    
    st = shp.CellsU("Comment").ResultStr(Visio.VisUnitCodes.visNoCast)
    If (Len(st) > 0) Then
    
      '// Shape has some screen-tippage:
      If (shp.CellExists( _
            UserCellName$, _
            Visio.VisExistsFlags.visExistsAnywhere) _
            = False) Then
            
        Call shp.AddNamedRow( _
              Visio.VisSectionIndices.visSectionUser, _
              UserRowName$, _
              Visio.VisRowTags.visTagDefault)
              
      '// The shape also needs to have at least one
      '// Shape Data field:
      If (shp.RowCount( _
            Visio.VisSectionIndices.visSectionProp) = 0) Then
        
        '// Add a dummy Shape Data field and hide it:
        Call shp.AddNamedRow( _
              Visio.VisSectionIndices.visSectionProp, _
              DummyShapeDataRowName$, _
              Visio.VisRowTags.visTagDefault)
        
        '// This HIDES the shape data field, it might also
        '// hide the tip in your web export. If so, change 1 to 0...
        shp.Cells(DummyShapeDataCellName$ & ".Invisible").ResultIU = 1
        '// ...and uncomment these two lines (they make
        '// the shape data field appear with no name and
        '// no value:
        shp.Cells(DummyShapeDataCellName$ & ".Value").FormulaForceU = ""
        shp.Cells(DummyShapeDataCellName$ & ".Label").FormulaForceU = Chr(34) & " " & Chr(34)
        
      End If
        
      End If
      
      shp.Cells(UserCellName$).FormulaForceU = "Comment"
      
    End If
      
  Next shp
  
  Set shp = Nothing
  Set pg = Nothing
  
End Sub

Public Sub EraseAllWebScreenTips()

  '// This tip removes User.visEquivTitle from every
  '// shape that has it. Ie: it cleans up what
  '// SetScreenTipsForWebExport did!
  
  Dim pg As Visio.Page
  Set pg = Visio.ActivePage
  
  Dim shp As Visio.Shape
  For Each shp In pg.Shapes
    
    '// Delete the user row, if it exists:
    If (shp.CellExists( _
          UserCellName$, _
          Visio.VisExistsFlags.visExistsAnywhere) _
          = True) Then
          
      Call shp.DeleteRow( _
            Visio.VisSectionIndices.visSectionUser, _
            shp.Cells(UserCellName$).Row)
                      
    End If
      
    '// Delete the dummy shape data row, if it exists:
    If (shp.CellExists( _
          DummyShapeDataCellName$, _
          Visio.VisExistsFlags.visExistsAnywhere) _
          = True) Then
          
      Call shp.DeleteRow( _
            Visio.VisSectionIndices.visSectionProp, _
            shp.Cells(DummyShapeDataCellName$).Row)
                      
    End If
    
  Next shp
  
  Set shp = Nothing
  Set pg = Nothing
    
End Sub

Open in new window

0
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
"screen-tippage"  -- nice, Chris  ;-)
0
 
Visio_GuyCommented:
What happens in code comments stays in code comments
0
 
nickmarkAuthor Commented:
Great job.
Sorry for the delay but I was working on this problem without Visio on my laptop.
Problem nicely solved!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now