Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.SendObject acSendNoObject, , ... does not open Outlook

Status
Not open for further replies.
Aug 10, 2001
15
0
0
AT
Hi, maybe someone can help me with this:
I have a form with a field. For the double click event I have the following code:
DoCmd.SendObject acSendNoObject, , acFormatRTF, Me!, , , , , -1, where Email is the field.

The problem is, there is a 'Tobit image messaging programm installed on the computer. When I double click the Text Box, it opens Tobit instead of Outlook.

Any code to solve this problem?

Many thanks in advance,
YvonneNina
 
It sounds like Access is telling you that Outlook is not your default mail application.
 
Hi jhall 156 and thank you for replying so quickly.

I thought of this too, the problem is, in the Windows Settings, Outlook IS the default mail application, but Tobit is installed as the default fax programm and does have this image messaging application which infact is a mail program too.

Since I am not familiar with Tobit, I don't know if I can inactivate the Tobit image messagig application without jeopardising the Fax option.

Kind regards,
YvonneNina

 
Have you considered using Outlooks exposed automation i.e. Outlook.Application? You can find a pretty extensive description of the collections, objects, properties and methods in Outlooks help files.
 
do not know if this is going to help, but how about first opening outlook and then transfering the info across automaticly.

Private Sub Command1_Click()
Dim RetVal
RetVal = Shell(""C:\Program Files\Outlook Express\msimn.exe"", 1)
End Sub
 
Thank you, Zeroanarchy for your hint. I tried this, in fact it opens outlook, but it opens it as many times as I double klick my field. Is there a way to prevent this?
 
YvonneNina,

If i am correct what you are trying to do is prevent the user from opening more than one copy of outlook at anyone time. If this is correct?

What you may want to do is on click change the focus to another invisible button. On gotfocus of the invisible button.

Have

me.outlookbutton.enabled = false

and try this to renable the button you could probably have,

In the invisible button.

Onlostfocus
me.outlookbutton.enabled = True

Someone else may have a better method of doing this, but I am sure this will be the path to follow.

Hope this is what you are after.

zero :)
 
Thank you for replying, my problem is, the user may wish to send three emails to three different persons via the email field. Outlook will open every time he sends a new email. In the end, he will have sent the three emails and Outlook will be open three times. What I would like is NOT to open Outlook but to only open the function New Mail of Outlook. Then, when the user opens Outlook by himself, the emails will be sent.

Thank you for bothering so much, Yvonne
 
Hi Yvonne

Try this.

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient

'Create Outlook Session
Set objOutlook = CreateObject("Outlook.Application")
'Create message
Set objOutlookMsg = objOutlook.CreateItem(Outlook.olMailItem)

'Set attributes for message
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(Email address)
objOutlookRecip.Type = Outlook.olTo
.Subject = "Insert Subject Here"
.Save
End With

Try this. It should create the mail items in Outlook even if it is not open, but will not send them.
You need to make sure you have the Microsoft Outlook Object Library enabled.(Tools, References)

Hope this helps. Let me know if you need more info.
Jo
 
Thank you jodennis, this is what I'm saying. I started out with nothing, and I still have most of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top