Checking if outlook is installed and sending email immediately

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

I use outlook automation to prepare emails from Access.

Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
..To = forms![frmemail]![txtToemail]
..Subject = "Email"
..Body = strMsg
..Save
..Send
End With

1. How can I make sure that Outlook is installed on end user's systems
before preparing the email ?

2. Also, if Outlook is not the default mail client then prepared emails just
sit in the outlook outbox. Is there any way to force Outlook to send out
prepared emails instead of keeping them in the outbox ?

3. Is there any way of accessing Outlook's global address book and put
addresses into a combobox on an Access form ?

Thanks very much.
 
Answers in-line:

Silvester said:
I use outlook automation to prepare emails from Access.

Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
.To = forms![frmemail]![txtToemail]
.Subject = "Email"
.Body = strMsg
.Save
.Send
End With

1. How can I make sure that Outlook is installed on end user's systems
before preparing the email ?

The first Dim statement will throw an error if Outlook isn't installed or
the reference doesn't exist.
2. Also, if Outlook is not the default mail client then prepared emails just
sit in the outlook outbox. Is there any way to force Outlook to send out
prepared emails instead of keeping them in the outbox ?

No, the user or admin must configure the email client. For security
purposes, this is likely to remain this way.
3. Is there any way of accessing Outlook's global address book and put
addresses into a combobox on an Access form ?

The 2 systems are asynchronous. I've been able to access an Access table to
fill an Outlook list box (it is very slow) but not the other way around. Try
asking this in an Outlook newsgroup. You may get a better answer.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top