Executing external Visual Basic Commands...

How do I execute/pass an eternal visual basic command/argument like:

.Documents.Add
.Selection.Paste

I want to copy a global to the clipboard, then launch Word, and paste the clipboard into the new Word document. Here’s my formula:

if(utils.stringMiddle(application.getOSName(),1,7) == “Windows”)
{
application.executeProgram(‘C:/Program Files/Microsoft Office/Office/WINWORD.EXE’);
}

I’m not sure how to pass info to the clipboard (is this the best way?), nor how to execute the command.

Also, the above causes Servoy to wig in different ways. I get a blank (grey) screen instead of the interface to my Servoy app.

Thanks in advance for any advice you have!

Providence

can’t you make a macro or something like that?

for example winword /mMACRONAME

http://www.michna.com/kb/WordCommandLineSwitches.htm

That works! However, the syntax is:

application.executeProgram(‘C:/Program Files/Microsoft Office/Office/WINWORD.EXE’,‘/mMACRONAME’);

In addition, if I try to Command-Tab back to Servoy I get a full utterly blank grey screen! I can’t get rid of it until I quit Word.

Any ideas?

Thanks for all your help!

Providence

Providence1:
In addition, if I try to Command-Tab back to Servoy I get a full utterly blank grey screen! I can’t get rid of it until I quit Word.

Any ideas?

Thanks for all your help!

Providence

Use execute in Background (executeProgramInBackground).
See documentation for details.

Has anyone had any luck passing the following kinds of visual basic commands:

application.executeProgramInBackground('C:/Program Files/Microsoft Office/OFFICE11/OUTLOOK.EXE'),'Dim olApp As Outlook.Application','Set olApp = CreateObject("Outlook.Application")', 'Dim olMail As Outlook.MailItem', 'Set olMail = olApp.CreateItem(olMailItem)', 'olMail.To = olItem.Email1Address', 'olMail.Subject = "RE:..."'

I could have sworn that it worked perfectly in a previous version.

Thanks in advance for any help you can provide

To ask it another way, launching mailto:? using rundll32.exe url.dll,FileProtocolHandler works, but you get you a new, blank Outlook email window with no signature.

Is there a way to get a signature block when launching a users Outlook app?