LJB
Tue Sep 04 06:42:16 PDT 2007
<dch35920@yahoo.com> wrote in message
news:1188682359.379607.193290@k79g2000hse.googlegroups.com...
> You can also develop your script using the VBA editor for one of the
> Office apps and then copy and paste it over. Most things written in
> VBA should work in VBScript with a minimum of alteration. Just keep
> the following in mind
>
> 1) VBScript does not support variable types VBA does. The line [Dim
> strMessage as String] in VBA must be changed to [Dim strMessage]
>
> 2) If your developing VBScript for a custom Outlook form, the
> controls only support the _click event the others that you would
> expect with VBA such as _onChange don't exist.
>
> 3) You might already know this but - VBScript does not support
> program flow (can't think of the correct term) so basically you can't
> use GOTO statements and labels which means that if you want to use
> error handling with the following code:
>
> SET objFSO = CreateObject("Scripting.FileSystemObject")
> objFSO.copyFile "c:\test.txt"
>
> You have to test the error object to see if an error occurred as in
>
> On Error Resume Next
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> objFSO.copyFile "c:\test.txt"
> if err.number <> 0 the msgbox "An error occurred."
>
> The [On Error Resume Next] statement can be at the top of your SUB or
> FUNCTION.
>
> There are probably some other issues, but I can't think of any at the
> moment.
>
I like the following which adds a context menu item to edit vbs files. It
uses the VBA editor from Excel. Run the scrip in the article to install the
feature. Run the script a second time to un-install it. I've used it for
several years and find it very handy.
http://groups.google.com/group/microsoft.public.scripting.vbscript/msg/47eae3bddee0f47e
LJB