Re: Get Visio Shape Properties



ipAddress is still set to nothing when it runs..

I think it has to do something when im pulling the arg from my
Prop.IPAddress and then im not giving it a value in my subroutine but
how do you do that?

CALLTHIS("ThisDocument.Telnet",,Prop.IPAddress)

on the double click seems to pull that value and the string variable is
setup in the sub but how do I set ipAddress to that value?


Michel LAPLANE wrote:
As you subroutine is called "Telnet", Instead You must put in the event
doubleClick this formula "CALLTHIS("ThisDocument.Telnet",,Prop.IPAddress)".
To see if it work add MsgBox in you subroutine :
Sub Telnet(shpObj As Visio.Shape, ipAddress As String)
MsgBox ipAddress
x = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler
telnet://ipAddress";, vbNormalFocus)
End Sub

<bryan.benway@xxxxxxxxx> a écrit dans le message de news:
1150125734.007331.241660@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Ok. I created the shape nad it has the property Prop.IPAddress and the
value is set to an IP, say 192.168.1.1.

Now in the shapesheet, I have in the EventDoubleClick:
CALLTHIS("ThisDocument.RunWithArg",,Prop.IPAddress)

Finally, in the vba script I have:
Sub Telnet(shpObj As Visio.Shape, ipAddress As String)
x = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler
telnet://ipAddress";, vbNormalFocus)
End Sub


Where do I tell the EventDoubleClick to run the Telnet subroutine
because on the doubleclick its not running anything.



Michel LAPLANE wrote:
1. Add a custom property to your router shape and call it "IpAddress".
2. Open the shapesheet of the shape and look the line name of the custom
property you have added. let say that visio has named it "Prop.Row_1"
3. Go to the event section and type
CALLTHIS("ThisDocument.RunWithArg",,Prop.Row_1) in the EventDblClick cell
4. Open the VBA editor and create this sub :
Sub Telnet(shpObj as Visio.Shape, ipAddress as string)
' call your process with the arg ipAddress
x = Shell .....
End sub.
5. Save and double click on the shape to test

<bryan.benway@xxxxxxxxx> a écrit dans le message de news:
1149783280.667810.214360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Can someone post a modified Sub that I can use. I dont think i follow
100% what you both are saying but thanks so much for the replies.



Michel LAPLANE wrote:
Look at the sdk help and use the CALLTHIS function you can pass some
parameters. The content of the EventDblClik cell could be
"CALLTHIS("ThisDocument.RunWithArg",,Prop.Row_1).
And the vba could be
Sub RunWithArg(shpObj as Visio.Shape,ipAddress as string)
MsgBox "This is my IP Address" + ipAddress
end sub

If the Prop.row_1 contain your ipadress it with work.

<bryan.benway@xxxxxxxxx> a écrit dans le message de news:
1149704135.066953.200290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I currently have a network map in Visio where I have macros setup on
the double click of a network item such as a router.

The current script is:

Sub Telnet()
x = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler
telnet://10.100.1.1";, vbNormalFocus)
End Sub

Which opens up a terminal session to the device.

In Visio, the Shape has an custom property that I want to pull into
the
function so when I double click each router, I can reference the same
function and not have to hard code the IPs into each sub


.



Relevant Pages

  • Re: Get Visio Shape Properties
    ... When you fire the event visio automatically pass the value to your sub you ... Add a custom property to your router shape and call it "IpAddress" as ... Label and "IpAddress" as Name and let the default type string. ... Which opens up a terminal session to the device. ...
    (microsoft.public.visio.developer)
  • Re: Get Visio Shape Properties
    ... Now in the shapesheet, ... Sub Telnet(shpObj As Visio.Shape, ipAddress As String) ... CALLTHISin the EventDblClick cell ...
    (microsoft.public.visio.developer)
  • Re: Get Visio Shape Properties
    ... As you subroutine is called "Telnet", Instead You must put in the event ... To see if it work add MsgBox in you subroutine: ... Sub Telnet(shpObj As Visio.Shape, ipAddress As String) ...
    (microsoft.public.visio.developer)
  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: FTP CD command
    ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)