experiment with runwithargs fails calling notepad.exe

A

art

Hi,

I just want to see the arg passing work. The developer group seems to
be devoid of good posts here. The microsoft docs and shown examples
seem to be too simplistic and not working examples to follow. Maybe I
chose the wrong program to call but I do not seem to get it to work.
Anyone see something obvious ?

=RUNADDON("notepad.exe")
Result: works , notepad starts but posts the following message box:
The system cannot find the path specified

=RUNADDONWARGS("notepad.exe","junk.txt")
Result: Notepad posts but does not find the file(should not be found)
and posts the following message box. The system cannot find the path
specified

=RUNADDONWARGS("notepad.exe","C:\Documents and Settings\Art\Desktop
\Test\experiment visio Macro library\junk.txt")
Result: Notepad starts but file is not loaded. – This should work --
The following message box: the filename , directory name or volume
label syntax is incorrect.

Eventually I want to call Vlan's vlc.exe video player with a video
file name to play. I can't seem to get it to work even with the call
without the arguements. Is this a dll problem that is not in the addon
path directory , ya think? I added the plugin directory for VLC also.

Thanks,
Art
 
P

Paul Herber

Hi,

I just want to see the arg passing work. The developer group seems to
be devoid of good posts here. The microsoft docs and shown examples
seem to be too simplistic and not working examples to follow. Maybe I
chose the wrong program to call but I do not seem to get it to work.
Anyone see something obvious ?

=RUNADDON("notepad.exe")
Result: works , notepad starts but posts the following message box:
The system cannot find the path specified

What version of Visio are you using?
If it's later than Visio 2000 what are your security settings?
Such actions as this are normally disabled unless you are running with
low security or the program you want to run is digitally signed, and
for some reason Notepad isn't! Hence, with later versions of Visio you
will either get a security warning or the action will not occurs at
all.
 
A

art

Hi Paul,

Thanks in advance !

I have Visio 2003 and here is the Security section settings. Pretty
much security is disabled as much as I knew how.

I have the Security Level is set to Low.
For the Macro Security I have everything enabled.
-VB for applications
-Application project creation
-DB for Applicataions projects from text
-Enable Com add-ins
-Enable Automation Events

I just wanted to see the argument passing to an application work. Then
built upon it elsewhere. It could be my chosen program has funny
arguement convention or the security or something else. I really love
Visio but I do get pretty frustrated with it at times like this.

Art
 
P

Paul Herber

Hi Paul,

Thanks in advance !

I have Visio 2003 and here is the Security section settings. Pretty
much security is disabled as much as I knew how.

I have the Security Level is set to Low.
For the Macro Security I have everything enabled.
-VB for applications
-Application project creation
-DB for Applicataions projects from text
-Enable Com add-ins
-Enable Automation Events

I just wanted to see the argument passing to an application work. Then
built upon it elsewhere. It could be my chosen program has funny
arguement convention or the security or something else. I really love
Visio but I do get pretty frustrated with it at times like this.

It's the security settings like this that stop any old program being
run. Even so, the program in RUNADDONWARGS has to be an addon that
Visio knows about or in Visio's add-ons path, so I'm not sure you will
be able to do what you want, on your own system maybe, but on anyone
other.
 
A

AlEdlund

I suspect you are correct, it isn't an addon it's a separate application.
The first thing I'd be testing is if I could start outlook with appropriate
arguments from the command window, and then work from there. If outlook can
be started from the command line with arguments then throw a shell command
at it.
al
 
V

visiSteve

I suspect you are correct, it isn't an addon it's a separate application.
The first thing I'd be testing is if I could start outlook with appropriate
arguments from the command window, and then work from there. If outlook can
be started from the command line with arguments then throw a shell command
at it.
al






- Show quoted text -

One way you could achieve the result you're after is with a little bit
of VBA. You could use the CALLTHIS ShapeSheet function like this:

CALLTHIS("ThisDocument.RunExtApp",,"C:\Windows
\System32\Notepad.exe","C:\Test.txt")

Then you would add a function to the ThisDocument VBA module:

Public Sub RunExtApp(visioShape As Visio.Shape, sExePath As String,
sArgs As String)

Shell sExePath & " """ & sArgs & """"

End Sub


Give that a try and see if it works.
 

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