Hi, need help with CC recipient in Outlook.
unable to set recipient.type to olCC.
; Create the Outlook session.
objOutlook = ObjectCreate("Outlook.Application")
; Create the message.
objOutlookMsg = objOutlook.CreateItem(0)
; Display to user (the following line can be removed if you do not want any interface)
objOutlookMsg.Display
; add Recipient
objOutlookRecip=objOutlookMsg.Recipients
objOutlookRecip.Add("someone@somewhere.net")
;______________________________________________________________________________
; ? HOW TO CC ?
;Recipients.Add('joesmoe@yahoo.com').Type := 2; // olCC VB example
objOutlookRecip.Add('joesmoe@yahoo.com').Type=2 * Does not work in WB? *
;______________________________________________________________________________
; Set the Subject, Body,
objOutlookMsg.Subject = "subject"
objOutlookMsg.Body = "objOutlookMsg.Body"
exit
Assuming that you mean that setting the recipient type does not seem to have any effect and that you are getting some kind of error, you need to the same thing for both VB and WinBatch. That thing being you need to call the ResolveAll method objOutlookRecip.ResolveAll()
on the recipients collection after you are done adding recipients.
thanks,
did that plus this:
objOutlookRecip.Add('someone@somewhere.com').Type = 2; // olCC
this put the recip on the cc line.
-domvalle