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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbs to vb

Status
Not open for further replies.

shepkrm

Programmer
Joined
Jul 29, 2004
Messages
38
Location
US
hello. i need to convert my vb script to straight vb so that i may compile it as an .exe.

confusing enough?

i am not sure how to convert my vbs to vb... i've included the code, not expecting someone to convert it for me, but for the sake of someone understanding what it is i'm trying to do.

thanks in advance for any advice!
becky

code:
''XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
''
''This program checks if a file exists and sends an email
''to the Notes user group
''
''XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Dim sFrom, sTo, sHost, sSubject, sBody
Dim sEmailArgs
Dim oFso, oMail

Set oFso=CreateObject("Scripting.FileSystemObject")

if oFso.FileExists("UDT.txt") Then
'Email to Notes Group
sFrom="FACETS@comp.com"
sTo="GES_Common_Feeds_IT@comp.com"
sHost="mail.comp.com"
sSubject="UDT Load - Success"
sBody="The UDT feed file has been successfully transferred to Common_Feeds."


else
'Email to Notes Group
sFrom="FACETS@comp.com"
sTo="GES_Common_Feeds_IT@comp.com"
sHost="mail.comp.com"
sSubject="UDT Load - Failure"
sBody="The UDT feed file was unsuccessful in its transfer to Common_Feeds."

end if


Set oFso=Nothing

'Setup e-mail object

sEmailArgs= sTo & "," & sFrom & "," & sSubject & "," & sBody & "," & sHost

Set oMail=CreateObject("WScript.Shell") 'email.exe
oMail.Run "i:\FACETS\email.exe " & sEmailArgs , 1, True

Set oMail=Nothing
 
Hello shepkrm,

vb takes late binding all right. Just add appropriate component references to the project. If you want early binding, checking out typename() of the various variables and take associated action in declaring them.

regards - tsuji
 
If you are going to continue using late binding, you may only need to declare your object reference variables [tt]As Object[/tt]. You might want to use the native "shell" facility as well instead of using the Windows Script Host Object Model.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top