hugostyles
Programmer
i have a vbs script - email.vbs
its a basic script to open an outlook message.
Set objOutlk = createobject("Outlook.Application")
Set objMail = objOutlk.createitem(olMailItem)
however when i run it, it returns a unspecified error, pointing to the line - "Set objOutlk = createobject("Outlook.Application")"
The script runs fine on my machine, but does not on a client machine. Could anyone help with where the problem might be.
***copy of the entire script ***
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
Set objOutlk = createobject("Outlook.Application")
Set objMail = objOutlk.createitem(olMailItem)
objMail.To = "test@swiftpro.com"
objMail.cc = "" 'Enter an address here To include a carbon copy; bcc
'Set up Subject Line
objMail.subject = "test from script"
'Add the body
strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an excellent rating!"
'To add an attachment, use:
'objMail.attachments.add("")
objMail.body = strMsg
objMail.display 'Use this To display before sending, otherwise call objMail.Send to send without reviewing
'Clean up
Set objMail = nothing
Set objOutlk = nothing
'end sub
its a basic script to open an outlook message.
Set objOutlk = createobject("Outlook.Application")
Set objMail = objOutlk.createitem(olMailItem)
however when i run it, it returns a unspecified error, pointing to the line - "Set objOutlk = createobject("Outlook.Application")"
The script runs fine on my machine, but does not on a client machine. Could anyone help with where the problem might be.
***copy of the entire script ***
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
Set objOutlk = createobject("Outlook.Application")
Set objMail = objOutlk.createitem(olMailItem)
objMail.To = "test@swiftpro.com"
objMail.cc = "" 'Enter an address here To include a carbon copy; bcc
'Set up Subject Line
objMail.subject = "test from script"
'Add the body
strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an excellent rating!"
'To add an attachment, use:
'objMail.attachments.add("")
objMail.body = strMsg
objMail.display 'Use this To display before sending, otherwise call objMail.Send to send without reviewing
'Clean up
Set objMail = nothing
Set objOutlk = nothing
'end sub