PDA

View Full Version : Programmatically loading vb reference libraries



counterrojo
12-27-2011, 06:40 PM
Hi,

I have used the following code to add a reference in Excel. I was wondering if anyone knows how to adapt this to work in OutLook.

Sub AddShellReferences()
On Error Resume Next
'Reference ADO Object Library using Major / Minor GUID
Set ID = ThisWorkbook.VBProject.References
ID.AddFromGuid "{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}", 1, 0
On Error GoTo 0
End Sub

Thanks!

Aflatoon
12-29-2011, 07:01 AM
As far as I know, there is no way to do that in Outlook. What are you trying to distribute that needs references added in code?

counterrojo
12-29-2011, 05:18 PM
I am using a shell application that needs the reference. It doesn't have to be in the code, I just thought that that would make it easier for the users.

Mike

JP2112
01-05-2012, 10:18 AM
This is the answer I go with:

http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/cff2e168-fbd4-4296-a670-243eab4eed3a/

counterrojo
01-05-2012, 10:25 AM
Thanks,!