Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create an ActiveX.exe that is called from a DOS Command Line? 1

Status
Not open for further replies.

metsey

Programmer
Mar 2, 2001
49
US
I have been requested to see if you can develop an ActiveX.exe that will take two input parameters-

Destination Email Address
File Attachment Name and Location

and automatically access Outlook and email the attachment to the Destination Email Address.

I can do the Outlook part, the only problem is they want to access the ActiveX.exe NOT from a VB app but from another Unix based app which would generate a command line script such as

C:\EmailProg\ActiveXEmailProg.exe

the problem is - how can I get the two input parameters to the ActiveX control through this command?

 
Why do you want to do this through a COM interface? If it is going to be called from the command line, use a regular EXE and then read the parameters as command line switches from the "Command" variable. - Jeff Marler B-)
 
when the exe opens how do I obtain the parameters from the command line switches
 
Use the Command$ instruction in Visual Basic. It returns whatever follows the actual application name when it is run. For example, given the following scenario -

<From the Command Prompt, your script called>

C:\MyApp.exe /A SomeData /B MoreData


<In your application Startup code - could be Sub Main - you had this code>
Public Sub Main
MsgBox Command$
End Sub



Run this is run, would would get a message box that read &quot;/A SomeData /B MoreData&quot;. You would simply need to add code to parse the string to look for the data that you needed.

If you are still stuck, list the parameters that you would be looking for, and I can give you a more concrete example . . .

- Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top