polyquoter
Programmer
I'm trying to send an email with an address and attachment from VB6. It works fine from my workstation which is running Outlook Express through a dial up connection. It does not work for my client who is running Outlook (not Outlook Express) on a NT network. The code below fails on the MAPIMessage.Send statement.
If I do not try and send an address or attachment then the Send statement will work on their system. It pulls up a blank New Message window. If they try and close this out they get an error 32001 User canceled process. I do not get this message from Outlook Express when I close the New Message window.
The MAPI error 32002 is of no help and I am puzzled why this works on Outlook Express but not just plain Outlook.
I'm wondering if it's some setting in Outlook or a DLL file problem.
I can send an email from their system with an address and an attachment using the Crystal Report MAPI objects but I want the user to be placed in the New Message window and have control over sending the message.
My code follows. Thanks in advance for your help.
MAPISession.LogonUI = True
MAPISession.SignOn
MAPIMessage.SessionID = MAPISession.SessionID
MAPIMessage.MsgIndex = -1
MAPIMessage.Compose
If tolist <> "" Then
MAPIMessage.RecipAddress = tolist
MAPIMessage.AddressResolveUI = True
MAPIMessage.ResolveName
End If
MAPIMessage.AttachmentPathName = "C:\Vatc\quote.rtf"
MAPIMessage.AttachmentName = "Quote.rtf"
MAPIMessage.Send True
MAPISession.SignOff
If I do not try and send an address or attachment then the Send statement will work on their system. It pulls up a blank New Message window. If they try and close this out they get an error 32001 User canceled process. I do not get this message from Outlook Express when I close the New Message window.
The MAPI error 32002 is of no help and I am puzzled why this works on Outlook Express but not just plain Outlook.
I'm wondering if it's some setting in Outlook or a DLL file problem.
I can send an email from their system with an address and an attachment using the Crystal Report MAPI objects but I want the user to be placed in the New Message window and have control over sending the message.
My code follows. Thanks in advance for your help.
MAPISession.LogonUI = True
MAPISession.SignOn
MAPIMessage.SessionID = MAPISession.SessionID
MAPIMessage.MsgIndex = -1
MAPIMessage.Compose
If tolist <> "" Then
MAPIMessage.RecipAddress = tolist
MAPIMessage.AddressResolveUI = True
MAPIMessage.ResolveName
End If
MAPIMessage.AttachmentPathName = "C:\Vatc\quote.rtf"
MAPIMessage.AttachmentName = "Quote.rtf"
MAPIMessage.Send True
MAPISession.SignOff