[OT] Using VBscript to send an email via outlook

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[OT] Using VBscript to send an email via outlook

Terry Judd-2
Hi all - I want (if possible) to use a VBscript to format and send emails from Livecode via Outlook on Windows ( I need to do it this way so that I can take advantage of Outlook's DeferredDeliveryTime feature).

Now, I know little or nothing about VBscript but the following routine (courtesy of a Google search) runs fine as a macro within Excel. If however I try to run it from Livecode (do [code] as "VBscript") it returns 'execution error' in the result. Does anyone know enough VBscript to tell me what I'm missing?

Regards,

Terry...

Sub SendMail()
Dim OutApp As Object
Dim Outmail As Object
Dim strBody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.session.logon
Set Outmail = OutApp.CreateItem(0)
strBody = "This is a test"
On Error Resume Next
With Outmail
    .To = "[hidden email]<mailto:[hidden email]>"
    .CC = ""
    .BCC = ""
    .Subject = "Test email"
    .Body = strBody
    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
    .Send
End With
On Error GoTo 0
Set Outmail = Nothing
Set OutApp = Nothing
End Sub


Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Mike Bonner
Try dumping the vbscript to a .vbs file and execute it with
shell("myfile.vbs")

In many cases it will just work. (probably send it to the temp folder so
you don't have to worry about cleanup afterwards)


On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]>wrote:

> Hi all - I want (if possible) to use a VBscript to format and send emails
> from Livecode via Outlook on Windows ( I need to do it this way so that I
> can take advantage of Outlook's DeferredDeliveryTime feature).
>
> Now, I know little or nothing about VBscript but the following routine
> (courtesy of a Google search) runs fine as a macro within Excel. If however
> I try to run it from Livecode (do [code] as "VBscript") it returns
> 'execution error' in the result. Does anyone know enough VBscript to tell
> me what I'm missing?
>
> Regards,
>
> Terry...
>
> Sub SendMail()
> Dim OutApp As Object
> Dim Outmail As Object
> Dim strBody As String
> Set OutApp = CreateObject("Outlook.Application")
> OutApp.session.logon
> Set Outmail = OutApp.CreateItem(0)
> strBody = "This is a test"
> On Error Resume Next
> With Outmail
>     .To = "[hidden email]<mailto:[hidden email]>"
>     .CC = ""
>     .BCC = ""
>     .Subject = "Test email"
>     .Body = strBody
>     .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>     .Send
> End With
> On Error GoTo 0
> Set Outmail = Nothing
> Set OutApp = Nothing
> End Sub
>
>
> Dr Terry Judd
> Senior Lecturer in Medical Education
> Medical Eduction Unit
> Faculty of Medicine, Dentistry & Health Sciences
> The University of Melbourne
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Ken Ray
In reply to this post by Terry Judd-2
Terry, I wouldn't use script that works inside a Microsoft app because that's likely to be *VBA* (VB for Applications) and not *VBS* (VB Script) and they have some differences. try looking for raw VBS examples. I'm not at my desk or I'd give you some code, but hopefully this will point you in the right direction.

Ken Ray
Sons of Thunder Software, Inc.

On Dec 16, 2012, at 1:18 PM, Terry Judd <[hidden email]> wrote:

> Hi all - I want (if possible) to use a VBscript to format and send emails from Livecode via Outlook on Windows ( I need to do it this way so that I can take advantage of Outlook's DeferredDeliveryTime feature).
>
> Now, I know little or nothing about VBscript but the following routine (courtesy of a Google search) runs fine as a macro within Excel. If however I try to run it from Livecode (do [code] as "VBscript") it returns 'execution error' in the result. Does anyone know enough VBscript to tell me what I'm missing?
>
> Regards,
>
> Terry...
>
> Sub SendMail()
> Dim OutApp As Object
> Dim Outmail As Object
> Dim strBody As String
> Set OutApp = CreateObject("Outlook.Application")
> OutApp.session.logon
> Set Outmail = OutApp.CreateItem(0)
> strBody = "This is a test"
> On Error Resume Next
> With Outmail
>    .To = "[hidden email]<mailto:[hidden email]>"
>    .CC = ""
>    .BCC = ""
>    .Subject = "Test email"
>    .Body = strBody
>    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>    .Send
> End With
> On Error GoTo 0
> Set Outmail = Nothing
> Set OutApp = Nothing
> End Sub
>
>
> Dr Terry Judd
> Senior Lecturer in Medical Education
> Medical Eduction Unit
> Faculty of Medicine, Dentistry & Health Sciences
> The University of Melbourne
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Terry Judd-2
Thanks Ken - yes I think you're right about it being VBA rather than VBS - I guess I naively assumed they were equivalent. I'll do a bit more searching and see if I can't turn up a VBS equivalent.

Cheers,

Terry...

On 17/12/2012, at 07:32 AM, Kennan Ray wrote:

> Terry, I wouldn't use script that works inside a Microsoft app because that's likely to be *VBA* (VB for Applications) and not *VBS* (VB Script) and they have some differences. try looking for raw VBS examples. I'm not at my desk or I'd give you some code, but hopefully this will point you in the right direction.
>
> Ken Ray
> Sons of Thunder Software, Inc.
>
> On Dec 16, 2012, at 1:18 PM, Terry Judd <[hidden email]> wrote:
>
>> Hi all - I want (if possible) to use a VBscript to format and send emails from Livecode via Outlook on Windows ( I need to do it this way so that I can take advantage of Outlook's DeferredDeliveryTime feature).
>>
>> Now, I know little or nothing about VBscript but the following routine (courtesy of a Google search) runs fine as a macro within Excel. If however I try to run it from Livecode (do [code] as "VBscript") it returns 'execution error' in the result. Does anyone know enough VBscript to tell me what I'm missing?
>>
>> Regards,
>>
>> Terry...
>>
>> Sub SendMail()
>> Dim OutApp As Object
>> Dim Outmail As Object
>> Dim strBody As String
>> Set OutApp = CreateObject("Outlook.Application")
>> OutApp.session.logon
>> Set Outmail = OutApp.CreateItem(0)
>> strBody = "This is a test"
>> On Error Resume Next
>> With Outmail
>>   .To = "[hidden email]<mailto:[hidden email]>"
>>   .CC = ""
>>   .BCC = ""
>>   .Subject = "Test email"
>>   .Body = strBody
>>   .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>>   .Send
>> End With
>> On Error GoTo 0
>> Set Outmail = Nothing
>> Set OutApp = Nothing
>> End Sub
>>
>>
>> Dr Terry Judd
>> Senior Lecturer in Medical Education
>> Medical Eduction Unit
>> Faculty of Medicine, Dentistry & Health Sciences
>> The University of Melbourne
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Terry Judd-2
In reply to this post by Mike Bonner
Thanks Mike - I'll give that a go. I've got a VBS script that is working from Livecode (below) but it seems to lock things up occastionally.

Regards,

Terry...

Set MyApp = CreateObject("Outlook.Application")
Set MyItem = MyApp.CreateItem(0)
With MyItem
.To = "[hidden email]"
.Subject = "Test email from Livecode via Outlook"
.Body = "This is a test"
.DeferredDeliveryTime = "17/12/2012 10:15:00"
.Send
End With


On 17/12/2012, at 06:25 AM, Mike Bonner wrote:

> Try dumping the vbscript to a .vbs file and execute it with
> shell("myfile.vbs")
>
> In many cases it will just work. (probably send it to the temp folder so
> you don't have to worry about cleanup afterwards)
>
>
> On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]>wrote:
>
>> Hi all - I want (if possible) to use a VBscript to format and send emails
>> from Livecode via Outlook on Windows ( I need to do it this way so that I
>> can take advantage of Outlook's DeferredDeliveryTime feature).
>>
>> Now, I know little or nothing about VBscript but the following routine
>> (courtesy of a Google search) runs fine as a macro within Excel. If however
>> I try to run it from Livecode (do [code] as "VBscript") it returns
>> 'execution error' in the result. Does anyone know enough VBscript to tell
>> me what I'm missing?
>>
>> Regards,
>>
>> Terry...
>>
>> Sub SendMail()
>> Dim OutApp As Object
>> Dim Outmail As Object
>> Dim strBody As String
>> Set OutApp = CreateObject("Outlook.Application")
>> OutApp.session.logon
>> Set Outmail = OutApp.CreateItem(0)
>> strBody = "This is a test"
>> On Error Resume Next
>> With Outmail
>>    .To = "[hidden email]<mailto:[hidden email]>"
>>    .CC = ""
>>    .BCC = ""
>>    .Subject = "Test email"
>>    .Body = strBody
>>    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>>    .Send
>> End With
>> On Error GoTo 0
>> Set Outmail = Nothing
>> Set OutApp = Nothing
>> End Sub
>>
>>
>> Dr Terry Judd
>> Senior Lecturer in Medical Education
>> Medical Eduction Unit
>> Faculty of Medicine, Dentistry & Health Sciences
>> The University of Melbourne
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne





_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Robert Sneidar
In reply to this post by Mike Bonner
Cannot do it that way. Scripts will not launch automatically. They must be invoked by using cscript myfile.vbs. HTH

Bob


On Dec 16, 2012, at 11:25 AM, Mike Bonner wrote:

> Try dumping the vbscript to a .vbs file and execute it with
> shell("myfile.vbs")
>
> In many cases it will just work. (probably send it to the temp folder so
> you don't have to worry about cleanup afterwards)
>
>
> On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]>wrote:
>
>> Hi all - I want (if possible) to use a VBscript to format and send emails
>> from Livecode via Outlook on Windows ( I need to do it this way so that I
>> can take advantage of Outlook's DeferredDeliveryTime feature).
>>
>> Now, I know little or nothing about VBscript but the following routine
>> (courtesy of a Google search) runs fine as a macro within Excel. If however
>> I try to run it from Livecode (do [code] as "VBscript") it returns
>> 'execution error' in the result. Does anyone know enough VBscript to tell
>> me what I'm missing?
>>
>> Regards,
>>
>> Terry...
>>
>> Sub SendMail()
>> Dim OutApp As Object
>> Dim Outmail As Object
>> Dim strBody As String
>> Set OutApp = CreateObject("Outlook.Application")
>> OutApp.session.logon
>> Set Outmail = OutApp.CreateItem(0)
>> strBody = "This is a test"
>> On Error Resume Next
>> With Outmail
>>    .To = "[hidden email]<mailto:[hidden email]>"
>>    .CC = ""
>>    .BCC = ""
>>    .Subject = "Test email"
>>    .Body = strBody
>>    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>>    .Send
>> End With
>> On Error GoTo 0
>> Set Outmail = Nothing
>> Set OutApp = Nothing
>> End Sub
>>
>>
>> Dr Terry Judd
>> Senior Lecturer in Medical Education
>> Medical Eduction Unit
>> Faculty of Medicine, Dentistry & Health Sciences
>> The University of Melbourne
>>
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Mike Bonner
Hmm. Seems like i've done exactly this very thing. Wil have to get out a
windows box and test.


On Mon, Dec 17, 2012 at 10:57 AM, Robert Sneidar <[hidden email]> wrote:

> Cannot do it that way. Scripts will not launch automatically. They must be
> invoked by using cscript myfile.vbs. HTH
>
> Bob
>
>
> On Dec 16, 2012, at 11:25 AM, Mike Bonner wrote:
>
> > Try dumping the vbscript to a .vbs file and execute it with
> > shell("myfile.vbs")
> >
> > In many cases it will just work. (probably send it to the temp folder so
> > you don't have to worry about cleanup afterwards)
> >
> >
> > On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]
> >wrote:
> >
> >> Hi all - I want (if possible) to use a VBscript to format and send
> emails
> >> from Livecode via Outlook on Windows ( I need to do it this way so that
> I
> >> can take advantage of Outlook's DeferredDeliveryTime feature).
> >>
> >> Now, I know little or nothing about VBscript but the following routine
> >> (courtesy of a Google search) runs fine as a macro within Excel. If
> however
> >> I try to run it from Livecode (do [code] as "VBscript") it returns
> >> 'execution error' in the result. Does anyone know enough VBscript to
> tell
> >> me what I'm missing?
> >>
> >> Regards,
> >>
> >> Terry...
> >>
> >> Sub SendMail()
> >> Dim OutApp As Object
> >> Dim Outmail As Object
> >> Dim strBody As String
> >> Set OutApp = CreateObject("Outlook.Application")
> >> OutApp.session.logon
> >> Set Outmail = OutApp.CreateItem(0)
> >> strBody = "This is a test"
> >> On Error Resume Next
> >> With Outmail
> >>    .To = "[hidden email]<mailto:[hidden email]>"
> >>    .CC = ""
> >>    .BCC = ""
> >>    .Subject = "Test email"
> >>    .Body = strBody
> >>    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
> >>    .Send
> >> End With
> >> On Error GoTo 0
> >> Set Outmail = Nothing
> >> Set OutApp = Nothing
> >> End Sub
> >>
> >>
> >> Dr Terry Judd
> >> Senior Lecturer in Medical Education
> >> Medical Eduction Unit
> >> Faculty of Medicine, Dentistry & Health Sciences
> >> The University of Melbourne
> >>
> >>
> >>
> >> _______________________________________________
> >> use-livecode mailing list
> >> [hidden email]
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Mike Bonner
sorry for the double. Even if you do have to run cscript by hand, can still
be done in a shell call.


On Mon, Dec 17, 2012 at 11:08 AM, Mike Bonner <[hidden email]> wrote:

> Hmm. Seems like i've done exactly this very thing. Wil have to get out a
> windows box and test.
>
>
> On Mon, Dec 17, 2012 at 10:57 AM, Robert Sneidar <[hidden email]> wrote:
>
>> Cannot do it that way. Scripts will not launch automatically. They must
>> be invoked by using cscript myfile.vbs. HTH
>>
>> Bob
>>
>>
>> On Dec 16, 2012, at 11:25 AM, Mike Bonner wrote:
>>
>> > Try dumping the vbscript to a .vbs file and execute it with
>> > shell("myfile.vbs")
>> >
>> > In many cases it will just work. (probably send it to the temp folder so
>> > you don't have to worry about cleanup afterwards)
>> >
>> >
>> > On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]
>> >wrote:
>> >
>> >> Hi all - I want (if possible) to use a VBscript to format and send
>> emails
>> >> from Livecode via Outlook on Windows ( I need to do it this way so
>> that I
>> >> can take advantage of Outlook's DeferredDeliveryTime feature).
>> >>
>> >> Now, I know little or nothing about VBscript but the following routine
>> >> (courtesy of a Google search) runs fine as a macro within Excel. If
>> however
>> >> I try to run it from Livecode (do [code] as "VBscript") it returns
>> >> 'execution error' in the result. Does anyone know enough VBscript to
>> tell
>> >> me what I'm missing?
>> >>
>> >> Regards,
>> >>
>> >> Terry...
>> >>
>> >> Sub SendMail()
>> >> Dim OutApp As Object
>> >> Dim Outmail As Object
>> >> Dim strBody As String
>> >> Set OutApp = CreateObject("Outlook.Application")
>> >> OutApp.session.logon
>> >> Set Outmail = OutApp.CreateItem(0)
>> >> strBody = "This is a test"
>> >> On Error Resume Next
>> >> With Outmail
>> >>    .To = "[hidden email]<mailto:[hidden email]>"
>> >>    .CC = ""
>> >>    .BCC = ""
>> >>    .Subject = "Test email"
>> >>    .Body = strBody
>> >>    .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>> >>    .Send
>> >> End With
>> >> On Error GoTo 0
>> >> Set Outmail = Nothing
>> >> Set OutApp = Nothing
>> >> End Sub
>> >>
>> >>
>> >> Dr Terry Judd
>> >> Senior Lecturer in Medical Education
>> >> Medical Eduction Unit
>> >> Faculty of Medicine, Dentistry & Health Sciences
>> >> The University of Melbourne
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> use-livecode mailing list
>> >> [hidden email]
>> >> Please visit this url to subscribe, unsubscribe and manage your
>> >> subscription preferences:
>> >> http://lists.runrev.com/mailman/listinfo/use-livecode
>> >>
>> > _______________________________________________
>> > use-livecode mailing list
>> > [hidden email]
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Using VBscript to send an email via outlook

Robert Sneidar
yup.

On Dec 17, 2012, at 10:11 AM, Mike Bonner wrote:

> sorry for the double. Even if you do have to run cscript by hand, can still
> be done in a shell call.
>
>
> On Mon, Dec 17, 2012 at 11:08 AM, Mike Bonner <[hidden email]> wrote:
>
>> Hmm. Seems like i've done exactly this very thing. Wil have to get out a
>> windows box and test.
>>
>>
>> On Mon, Dec 17, 2012 at 10:57 AM, Robert Sneidar <[hidden email]> wrote:
>>
>>> Cannot do it that way. Scripts will not launch automatically. They must
>>> be invoked by using cscript myfile.vbs. HTH
>>>
>>> Bob
>>>
>>>
>>> On Dec 16, 2012, at 11:25 AM, Mike Bonner wrote:
>>>
>>>> Try dumping the vbscript to a .vbs file and execute it with
>>>> shell("myfile.vbs")
>>>>
>>>> In many cases it will just work. (probably send it to the temp folder so
>>>> you don't have to worry about cleanup afterwards)
>>>>
>>>>
>>>> On Sun, Dec 16, 2012 at 12:18 PM, Terry Judd <[hidden email]
>>>> wrote:
>>>>
>>>>> Hi all - I want (if possible) to use a VBscript to format and send
>>> emails
>>>>> from Livecode via Outlook on Windows ( I need to do it this way so
>>> that I
>>>>> can take advantage of Outlook's DeferredDeliveryTime feature).
>>>>>
>>>>> Now, I know little or nothing about VBscript but the following routine
>>>>> (courtesy of a Google search) runs fine as a macro within Excel. If
>>> however
>>>>> I try to run it from Livecode (do [code] as "VBscript") it returns
>>>>> 'execution error' in the result. Does anyone know enough VBscript to
>>> tell
>>>>> me what I'm missing?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Terry...
>>>>>
>>>>> Sub SendMail()
>>>>> Dim OutApp As Object
>>>>> Dim Outmail As Object
>>>>> Dim strBody As String
>>>>> Set OutApp = CreateObject("Outlook.Application")
>>>>> OutApp.session.logon
>>>>> Set Outmail = OutApp.CreateItem(0)
>>>>> strBody = "This is a test"
>>>>> On Error Resume Next
>>>>> With Outmail
>>>>>   .To = "[hidden email]<mailto:[hidden email]>"
>>>>>   .CC = ""
>>>>>   .BCC = ""
>>>>>   .Subject = "Test email"
>>>>>   .Body = strBody
>>>>>   .DeferredDeliveryTime = "16/12/2012 16:00:00" 'dd/mm/yyyy hh:mm:ss'
>>>>>   .Send
>>>>> End With
>>>>> On Error GoTo 0
>>>>> Set Outmail = Nothing
>>>>> Set OutApp = Nothing
>>>>> End Sub
>>>>>
>>>>>
>>>>> Dr Terry Judd
>>>>> Senior Lecturer in Medical Education
>>>>> Medical Eduction Unit
>>>>> Faculty of Medicine, Dentistry & Health Sciences
>>>>> The University of Melbourne
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> use-livecode mailing list
>>>>> [hidden email]
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode