vb6 - VBScript: Assigning an array(2) via createobject -


i'm having problem converting vb6 code vbscript. i'm calling out com object create array emailaddresstype. here working vb6 code:

'assign to: addresses dim toadresses(2) new emailaddresstype toadresses(0).emailaddress = "someone@whocares.com" toadresses(0).routingtype = "smtp" toadresses(1).emailaddress = "someoneelse@whocares.com" toadresses(1).routingtype = "smtp" email.torecipients = toadresses 

i can't seem figure out how convert vbscript. i've tried following type mismatch error once email.torecipients = toadresses

  'assign to: addresses    dim toadresses(2)    set toadresses(0) = createobject("ews.ewswebsvc.emailaddresstype")    set toadresses(1) = createobject("ews.ewswebsvc.emailaddresstype")     toadresses(0).emailaddress = "someone@whocares.com"     toadresses(0).routingtype = "smtp"     toadresses(1).emailaddress = "someoneelse@whocares.com"     toadresses(1).routingtype = "smtp"     email.torecipients = toadresses 

btw com wrapper of exchange web services if helps any.

i think problem .torecipients property wants array of emailaddresstype while can in vbscript variant or array of variants.

looks api not built scriptable.

oddly enough there implication can used jscript though: messagetype.torecipients property

i suspect rewriting history gradually editing out mention of vbscript on msdn these days though.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -