How can I add a reference to Outlook

N

nguyenxuanson

I am reading the code of Ron de Bruin
http://www.rondebruin.nl/sendmail.htm
But have error "User-defined type not define" when runt he code,
Sub Mail_ActiveSheet_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
.....

Can someone tell me how can I add a reference to the Outlook library
please.
Xs
 
N

nguyenxuanson

when I look at VBA editor (Alt F11) then Tools then Reference, I can
not find the Outlook Library but only Micsrosoft Outlook View...
XS
 
E

Eric Legault [MVP - Outlook]

First, I assume you do have Outlook installed of course. Second, do you see
"Microsoft Outlook X.0 Library" (X depends on version; i.e. 9.0, 10.0, 11.0)
in the list?

Also check for this key in the registry:

HKEY_CLASSES_ROOT\Outlook.Application.X

If that is there, you should also have these keys and values:


[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}]
@="Microsoft Office Outlook"

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocHandler32]
@="ole32.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocServer32]
"Class"="Microsoft.Office.Interop.Outlook.ApplicationClass"
"RuntimeVersion"="v1.1.4322"
"Assembly"="Microsoft.Office.Interop.Outlook, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c"

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocServer32\11.0.0.0]
"Class"="Microsoft.Office.Interop.Outlook.ApplicationClass"
"RuntimeVersion"="v1.1.4322"
"Assembly"="Microsoft.Office.Interop.Outlook, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=71e9bce111e9429c"

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\LocalServer32]
@="C:\\PROGRA~1\\MI699F~1\\OFFICE11\\OUTLOOK.EXE"
"LocalServer32"=hex(7):27,00,5d,00,67,00,41,00,56,00,6e,00,2d,00,7d,00,66,00,\
28,00,5a,00,58,00,66,00,65,00,41,00,52,00,36,00,2e,00,6a,00,69,00,4f,00,55,\
00,54,00,4c,00,4f,00,4f,00,4b,00,46,00,69,00,6c,00,65,00,73,00,3e,00,69,00,\
72,00,40,00,58,00,37,00,63,00,72,00,24,00,25,00,40,00,75,00,24,00,7d,00,26,\
00,56,00,37,00,7b,00,34,00,70,00,27,00,00,00,00,00

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\ProgID]
@="Outlook.Application.11"

[HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}\Typelib]
@="{00062FFF-0000-0000-C000-000000000046}"
 

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