[pmmail-list] Catching passed email file in VisualBasic or VBS

Tim Roberts pmmail-list@blueprintsoftwareworks.com
Mon, 08 Dec 2003 10:00:09 -0800


On Sun, 07 Dec 2003 22:45:29 -0500, Steve Barber wrote:
>
>Now that I'm on Win98, I've managed to rewrite the thing in
>Visual Basic 6 ... works fine, but I haven't been able to
>figure out how to get it to expect a passed in parameter
>(the email's file name) like I could do in REXX ... VB 6 is
>ok if you want to build windows object stuff, but it's not
>easy to understand how to write a simple procedural program
>like it was in REXX.  It's almost like once they figured
>out how to get VB to do windows with a person using the
>window as a UI, the forgot that it's sometimes nice to do
>old fashioned procedural programs that don't have a UI.

No, it's all still in there.  It's just a bit hard to find.

>I've tried the same thing in VBScript .. and can read and
>write files, but can't figure out how to catch that passed
>in file name.
>
>So has anybody done that with VB 6 or with VBScript?  Any
>clues on how to do that in either language ... but
>preferrably in VB 6 ... would be most welcome.

In VBScript, you need to look at the first entry in the WScript.Arguments
collection:

   For Each arg In WScript.Arguments
      WScript.Echo arg
   Next arg

So WScript.Arguments(0) has the first argument.

In Visual Basic, the entire command line (beyond the file name) is
returned by the global function Command$, as one long string.  For
multiple arguments, you have to parse it yourself.
--
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.


- pmmail-list - The PMMail Discussion List ---------------------------
To POST to the list, send your message to:
pmmail-list@blueprintsoftwareworks.com

To UNSUBSCRIBE, send a message to mdaemon@bmtmicro.com 
with the first line of the message body being...
UNSUBSCRIBE pmmail-list@blueprintsoftwareworks.com
---------------------------------------------------------------------