Scheduled Task Doesn't work with Outlook 2007

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top