#207757 - 2013-09-17 04:45 PM
$Root = CreateObject("Outlook.Application") does not launch outlook 2010
|
Karon
Getting the hang of it
Registered: 2009-07-16
Posts: 87
Loc: Texas
|
If I have outlook 2010 open, my kix script work. However, if outlook is closed,
$Root = CreateObject("Outlook.Application") will not launch outlook to send the emails. Any ideas? Thanks
|
|
Top
|
|
|
|
#207764 - 2013-09-17 11:14 PM
Re: $Root = CreateObject("Outlook.Application") does not launch outlook 2010
[Re: Lonkero]
|
Karon
Getting the hang of it
Registered: 2009-07-16
Posts: 87
Loc: Texas
|
I have looked everywhere and cannot find the command to launch outlook 2010 in kix. This is what I have:
;main program loop
$rc = SetOption("NoMacrosInStrings","On")
$rc = SetOption("NoVarsInStrings","On")
; create outlook application
$Root = CreateObject("Outlook.Application")
$MailItem = $Root.CreateItem(0)
$MailItem.Importance = 1
; - 2 high importance
; - 1 normal importance
; - 0 low importance
$MailItem.Subject = "This is the subject"
$MailItem.Sender = "namesender@mail.net"
$MailItem.To = "nameto@mail.net"
$MailItem.CC = "namecc@mail.net"
$MailItem.Body = "This is the body"
;EndIf
$MailItem.Send
$Root = 0
If anyone can supply the command to launch and where it will go in this script I would really appreciate it!
|
|
Top
|
|
|
|
#207773 - 2013-09-18 04:00 PM
Re: $Root = CreateObject("Outlook.Application") does not launch outlook 2010
[Re: Karon]
|
Karon
Getting the hang of it
Registered: 2009-07-16
Posts: 87
Loc: Texas
|
I got it!!
$Root = CreateObject("Outlook.Application")
$Session = $Root.GetNamespace("MAPI")
$DefaultProfile = Outlook
$Session.Logon($DefaultProfile)
$Folder = $Session.GetDefaultFolder(olFolderInbox)
$Folder.Display
I found the info at Launch outlook 2010
Now the script launches outlook, e-mails as necessary and closes outlook!
;main program loop
$rc = SetOption("NoMacrosInStrings","On")
$rc = SetOption("NoVarsInStrings","On")
; create outlook application
$Root = CreateObject("Outlook.Application")
$Session = $Root.GetNamespace("MAPI")
$DefaultProfile = Outlook
$Session.Logon($DefaultProfile)
$Folder = $Session.GetDefaultFolder(olFolderInbox)
$Folder.Display
$MailItem = $Root.CreateItem(0)
$MailItem.Importance = 1
; - 2 high importance
; - 1 normal importance
; - 0 low importance
$MailItem.Subject = "Subject Text"
$MailItem.Sender = "sender@mail.net"
$MailItem.To = "to@mail.net"
$MailItem.CC = "cc@mail.net"
$MailItem.Body = "Body of the Message"
;EndIf
$MailItem.Send
$Root = 0
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|