eventdblclick call to local file, publishing visio 2k3 on web (limitsof functionality?)

D

Dr. Dre

Hi There,

Some quick questions...

1. I'm in the process of creating a data center visualization
layout. And I'm having trouble with the following:

a. I create a room overhead with individual racks, when I double-click
on a given rack, it opens an existing sheet with rack contents. The
issue I have is if I double-click on my 15th rack, it will jump to the
15th tabbed sheet, if I want to return to the original view (1st tab),
I have to jump to the first page.. which isn't a big deal, but it's
not very intuitive... Is there a better way I can do this? (Have the
double-click result in creating a new window I can close to return to
the original, etc)

b. Again, if I double-click on a rack, it opens a tabbed sheet and
shows me the contents.. now, what I'd like visio to do, is when I
double-click on a given component in the rack, have the dblclick event
open a local file on the user's desktop (in this case, a standard
telnet program)

I've tried:
=OPENFILE("C:\Program Files\SecureCRT\SecureCRT.EXE") (does nothing)
=GOTOPAGE("C:\Program Files\SecureCRT\SecureCRT.EXE") (results in an
error regarding complaining about the file not being a visio file, or
being corrupt)

Can't figure it out.

Lastly,

2. Is there anyway to preserve the eventdblclick functionality if I
published the visio sheet to the web?


Thanks!

DD
 
A

Al Edlund

some thoughts that might be of help.
check this out for moving between pages in a visio document

http://blogs.msdn.com/visio/archive/2006/06/27/647570.aspx

The ability to call external applications can be complicated based on
operating system and browser. One technique is to wrap your functionality in
a shell script and call it as a macro. Something like this


al

Public Sub TelnetToTarget(ByRef visWin As Visio.Window, _
ByVal strShape As String)

On Error GoTo ErrHandler

Dim visPage As Visio.Page
Dim visShapes As Visio.Shapes
Dim visShape As Visio.Shape
Dim visCell As Visio.Cell
Dim shellWin As Object
Dim strCommand As String
strCommand = "c:\windows\system32\telnet "

Set visPage = visWin.Page
Set visShapes = visPage.Shapes
Set visShape = visShapes.Item(strShape)
' can we determine the rules appropriate
' if there get ip address if not get out
If visShape.CellExists("prop.compIpAddress", False)
Then
Set visCell = visShape.Cells("prop.compIpAddress")
strCommand = strCommand & visCell.ResultStr("")
Else
MsgBox ("couldn’t find compIpAddress custom
property")
Exit Sub
End If

' create the script shell environment
Set shellWin = CreateObject("wscript.shell")

' now execute the command that we built
'Debug.Print "shellwin start"
DoEvents
shellWin.Run strCommand
DoEvents
Exit Sub
ShellCommand:
'Debug.Print "shell start"
Shell strCommand, vbNormalFocus
'Debug.Print "shell start"
DoEvents
Exit Sub
ErrHandler:
Dim myErr As ErrObject
Set myErr = Err

If Err.Number = -2147024894 Then
Debug.Print "shellwin failed"
GoTo ShellCommand
End If

Debug.Print "telnet " & Err.Description


End Sub
 
D

Dr. Dre

some thoughts that might be of help.
check this out for moving between pages in a visio document

http://blogs.msdn.com/visio/archive/2006/06/27/647570.aspx

The ability to call external applications can be complicated based on
operating system and browser. One technique is to wrap your functionality in
a shell script and call it as a macro. Something like this

al

Public Sub TelnetToTarget(ByRef visWin As Visio.Window, _
ByVal strShape As String)

On Error GoTo ErrHandler

Dim visPage As Visio.Page
Dim visShapes As Visio.Shapes
Dim visShape As Visio.Shape
Dim visCell As Visio.Cell
Dim shellWin As Object
Dim strCommand As String
strCommand = "c:\windows\system32\telnet "

Set visPage = visWin.Page
Set visShapes = visPage.Shapes
Set visShape = visShapes.Item(strShape)
' can we determine the rules appropriate
' if there get ip address if not get out
If visShape.CellExists("prop.compIpAddress", False)
Then
Set visCell = visShape.Cells("prop.compIpAddress")
strCommand = strCommand & visCell.ResultStr("")
Else
MsgBox ("couldn't find compIpAddress custom
property")
Exit Sub
End If

' create the script shell environment
Set shellWin = CreateObject("wscript.shell")

' now execute the command that we built
'Debug.Print "shellwin start"
DoEvents
shellWin.Run strCommand
DoEvents
Exit Sub
ShellCommand:
'Debug.Print "shell start"
Shell strCommand, vbNormalFocus
'Debug.Print "shell start"
DoEvents
Exit Sub
ErrHandler:
Dim myErr As ErrObject
Set myErr = Err

If Err.Number = -2147024894 Then
Debug.Print "shellwin failed"
GoTo ShellCommand
End If

Debug.Print "telnet " & Err.Description

End Sub

Hi Al,

Thanks for responding.. I did as you mentioned, but the script keeps
giving me a syntax error with the line:
If visShape.CellExists("prop.compIpAddress", False)
Then

Everytime I try and compile the script.

What am I doing wrong?
 
A

Al Edlund

The script calls telnet using the ip address that is stored in the shape. The
custom property name it is using is compIpAddress. This gives me the ability
to select a shape and the telnet to the object. Of course you can name the
property whatever you want. It's just a short cut to make it easier on the
user.
al
 

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