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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAPI without forms 1

Status
Not open for further replies.

trids

Programmer
Feb 23, 2001
21
Hi folks

Any ideas on how to use the MAPI OCXes without using a form? I need to write a DLL without any need for user-input, and it seems a bit wasteful to include a form that will never be shown, just for the sake of of an OCX or two.

I'm sure I'm overlooking the obvious :eek:)
 
Rather than using the MAPI Controls, put in a reference to Microsoft CDO library. This gives you full access to MAPI via objects ie.

Dim objMail As MAPI.Message
Dim objRecipient As MAPI.Recipient
Dim objMapiAttachment As MAPI.Attachment
Dim objFile As MAPI.Attachment

Hope this helps,

Chris Dukes
 
I'm overlooking something
sub main()
Dim objMail As MAPI.Message
...

Yields 'user defined object not defined.' which is understandable, how do you get the MAPI into in the first place?

I'm sure it is a 'duh' but one I don't know yet.
 
Thanks Chris!

That seems to be exactly what i'm after.

Just struggled a bit with the Recipient.Address property ..

I simply wanted to use a regular "xxx@here.com" kind of address, but the Recipient object seems to want to interpret (resolve) address-book entries etc. See, the address is received at runtime, and won't be in the user's address book. But I finally got "SMTP:xxx@here.com" to work.

Thanks again!

 
Goto Project/References and look for Microsoft CDO Library and Click the check box. If you don't have Microsoft CDO, search your hard drive for CDO.DLL or download it from the microsoft/MSDN site.

Hope this helps,

Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top