Scheduled Task Doesn't work with Outlook 2007

Status
Not open for further replies.
C

CaptainBly

I have a small Access application that runs, initiates an instance of

Outlook, creates necessary emails, and exits. This is running on a

server as a scheduled task.

This worked fine with Outlook 2003. Client did a server upgrade and

upgraded to Outlook 2007. Now this task fails. If Outlook is open,

it runs fine but it fails if outlook is closed.

Is there a way to do this in Outlook 2007 without having Outlook open?

Any help is greatly appreciated.

Here is snippets of the code. It bombs on the recipients.add line.

If Outlook is open though, it runs without issue. Just not super

practical on a server with a scheduled task.

Set olookApp = New Outlook.Application

> .

> . some other unrelated code here, setting up a while loop etc...

> .

emailto = artsenddetail![emailaddress]

Set olookMsg = olookApp.CreateItem(olMailItem)

With olookMsg

Set olookRecipient = .Recipients.Add(emailto)

olookRecipient.Type = olTo

> Subject = "Art Verification - Project: " & artsend!

[BudgetNum] & " " & artsend![BudgetName]

> Body = control![ArtVerifyBody] & newline & newline &

standardclosing

If Not (IsNull(control![CompanyEmail])) Then

> ReplyRecipients.Add (control![CompanyEmail])

End If

Set olookAttach = olookMsg.Attachments.Add(filenamedest)

olookMsg.Send

End With
 
C

CaptainBly

Further information... The error I get is 287 - Application-defined

or object-defined error
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
M Use New-MailboxExportRequest as a scheduled task Exchange Server Administration 5
M Running Outlook as Scheduled task Outlook VBA and Custom Forms 1
O Scheduled Task Fails running Code to send Outlook Mail from Excel. Outlook VBA and Custom Forms 9
V Scheduled backup of imap account Using Outlook 7
T Scheduled footer change Using Outlook 2
M Outlook does not bold calendar dates when events are scheduled for those dates. Using Outlook 1
T Resource room not sending notfications when meetings are scheduled from Outlook Using Outlook 3
D Outlook 2010 won't perform Send/Receive on IMAP folders as scheduled Using Outlook 2
S Meetings Scheduled To A Resource Via Outlook 2007, Do Not Book Using Outlook 1
H Scheduled a meeting and the organizer go set to an invitee. Using Outlook 1
M WBADMIN Scheduled Backup for Exchange 2010 Fails with Event ID 544 Error Exchange Server Administration 5
C Scheduled meeting delivers an email instead of a meeting notice. Using Outlook 2
M Sending an email invite to a scheduled reoccurring series of meetings at once even though certain occurrences in the series have been modified. Using Outlook 1
S "You do not have permission to send to this recipient" when making changes to scheduled meetings Using Outlook 3
A Possible to Disable send receive at startup, but keep scheduled send receive active? Using Outlook 3
S Scheduled backup for BCM Database Tool BCM (Business Contact Manager) 1
C How do you add an attendee to a already scheduled meeting? Using Outlook 3
J Office 365 erased all of my task views Using Outlook 3
T Report For Task Recurrance Outlook VBA and Custom Forms 3
E Can't accept or decline task (no button appears) Using Outlook 4
B VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
B Task Filter Not Working When I add too many criteria Using Outlook 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
B How to show concatenated categories in list task view? Using Outlook 2
B VBA to Collapse Task Folder Groups Outlook VBA and Custom Forms 1
E To convert imported data to custom fields in Task list Outlook VBA and Custom Forms 1
I Help with dates in task list. Using Outlook 5
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
M Daily Task List Minimized Cannot Display Using Outlook 2
D Using a VBA Custom Form to Send Reoccurring Email Upon Task Completion Outlook VBA and Custom Forms 4
P Add a contact to the New Task in Outlook 2016 Using Outlook 2
S Codes for "Mark Complete" the task Outlook VBA and Custom Forms 2
W Deleting Sent Task Email, Deletes the task from my list Using Outlook 1
K Task priority modification Using Outlook 4
F Search folder for tasks in all task folders Using Outlook 1
JohnViuf Export task list view settings to other pc Outlook VBA and Custom Forms 16
V Changing default date for task follow-up buttons Using Outlook 2
K outlook workflow: automated task generation Outlook VBA and Custom Forms 4
U HTML Task Alternate Home Page View Control Using Outlook 3
F How to assign a task to a public task folder? Using Outlook 1
J Marketing task MS BCM BCM (Business Contact Manager) 10
copperberry How to view all tasks across task folders Using Outlook 3
P Task Categories Using Outlook 2
P Run Time Error 91 when linking contact to task in VBA Outlook VBA and Custom Forms 1
L Email to task without changin formatting Outlook VBA and Custom Forms 16
S BCM Project Task Order BCM (Business Contact Manager) 1
P Custom form reverts from task Outlook VBA and Custom Forms 1
evdbogaard How to dock the Styles Task Pane in the e-mail editing window? Outlook VBA and Custom Forms 1
S Default Font in body of Task Using Outlook 0
S set a flag task date as the next weekday Outlook VBA and Custom Forms 4
Similar threads


















































Top