PC Review


Reply
Thread Tools Rate Thread

Add reference to Outlook library programmatically

 
 
Hiran
Guest
Posts: n/a
 
      21st Oct 2008
Hi,
Can someone tell me how to programmatically add a reference to a
library (Outlook, in my case) ?

Thanks,
Hiran

 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      21st Oct 2008
Hi Hiran

Why not use Late binding

I use it here for example
http://www.rondebruin.nl/mail/folder2/mail2.htm

See the info about Early binding below the macro


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Hiran" <(E-Mail Removed)> wrote in message news:cd405ba8-6a70-42e7-b86b-(E-Mail Removed)...
> Hi,
> Can someone tell me how to programmatically add a reference to a
> library (Outlook, in my case) ?
>
> Thanks,
> Hiran
>

 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      21st Oct 2008
Try something like

Sub AddOutlookRef()
' reference current installed version of Outlook
On Error Resume Next 'ignore if already set
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00062FFF-0000-0000-C000-000000000046}", _
major:=0, Minor:=0
End Sub

You can add a reference to any file if you know the file name:

Sub AAA()
ThisWorkbook.VBProject.References.AddFromFile _
Filename:="C:\Path\FileName.ext"
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Tue, 21 Oct 2008 09:49:47 -0700 (PDT), Hiran <(E-Mail Removed)>
wrote:

>Hi,
>Can someone tell me how to programmatically add a reference to a
>library (Outlook, in my case) ?
>
>Thanks,
>Hiran

 
Reply With Quote
 
Hiran
Guest
Posts: n/a
 
      22nd Oct 2008
Thanks Ron and Chip. You guys are priceless!
Hiran
 
Reply With Quote
 
Hiran
Guest
Posts: n/a
 
      13th Nov 2008
Chip,
I'm now trying to use this to add the ADO2.8 library (msado 15.dll)
and I get Run-time error '48' 'Error in loading DLL'.
What am I missing?
Thanks,
Hiran


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't load MSOUTL.olb (Outlook Reference Library) in VBA =?Utf-8?B?Z21zdWxsaXZhbg==?= Microsoft Access VBA Modules 3 21st Jul 2006 01:09 AM
Reference to Outlook 8.0 Object Library keeps disappearing =?Utf-8?B?VGltIExvbmc=?= Microsoft Access VBA Modules 0 12th Jul 2005 08:52 PM
programmatically Set Reference to Library Todd uttenstine Microsoft Excel Programming 6 30th Apr 2004 10:55 AM
Outlook library reference file Cindy Microsoft Outlook VBA Programming 4 2nd Apr 2004 05:51 AM
Bad Reference to Outlook library causing problems Pepper Microsoft Access Forms 0 20th Nov 2003 03:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:21 PM.