473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Enabling Outlook Object Library using vba/Shell command

I need to enable the Outlook object library (MSOUTL.olb) to enable my database to send emails (I have tried many methods, this seems to be the only method that doesn't fall fowl of the computers security, and works in runtime).

I enable microsoft scripting runtime on each computer using my database by the following code:
Expand|Select|Wrap|Line Numbers
  1. Shell ("c:\windows\system32\regsvr32.exe c:\windows\system32\scrrun.dll")
  2.  
But regsvr32 does not run olb files, only ocx and dll.

is there any way of enabling outlook library without tediously manually doing it in visual basic editor on every computer?
Feb 21 '11 #1
3 3592
NeoPa
32,556 Expert Mod 16PB
Why would you need to James?

My understanding is that the library or reference is enabled at the database level, and thus is enabled on any PC it's run on. The portability issues come when the PCs involved either don't have Outlook installed, have it installed differently (in a different locastion) or have the wrong version installed. Essentially, Access looks for a particular file existing in a particular folder. As long as you ensure that file exists where it's expected to be found, the reference will hold.

NB. The file is part of a licensed package, so it is your responsibility to ensure you don't contravene the agreement of those licenses.
Feb 21 '11 #2
I've just checked, and you're right. It does.

Apparently the problem I am having is that the following works on some computers, and not others.

Expand|Select|Wrap|Line Numbers
  1. Set Mail_Object = CreateObject("Outlook.Application")
  2. Set Mail_Single = Mail_Object.CreateItem(0)
  3. With Mail_Single
  4. .Subject = sSubject
  5. .To = sName
  6. .Body = Stext1
  7. .Send
  8. End With
  9.  
For some reason, the .send part works on some computers, but not others, despite the fact that they all seem to have identical reference libraries loaded.

Which is causing me a quite considerable headache.

Forgot to mention, the computers are all supposedly identical too...

Running Windows 7, Office 2010
Feb 21 '11 #3
NeoPa
32,556 Expert Mod 16PB
I suggest you post this new question in a separate thread James, with a title that matches the problem and brings in those who can probably help you. You would need to include the code, as well as the line and error message of any failure. I'm happy for you to post a link in here for me to look at it for you, but it's not an area where I'm very experienced, so I may not be your best resource on this one. Get a good title and a clearly explained problem though, and I'd be surprised if you don't find at least one expert who does have the relevant experience.
Feb 21 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Girish NS | last post by:
Hi, I'm trying to store appointment data to outlook appointments from a c# application. So I'm using outlook object model thru COM interop. But in the applicaton some of the methods like...
3
by: RJN | last post by:
Hi I'm trying to create a windows task through code. I could do this through the shell command and the WMIService in .net exe. But the same doesn't work from asp.net. Any idea? This is the code...
2
by: John Davis | last post by:
In VB.NET, sounds like we no longer can use Microsoft Outlook Object Library (MSOUTL.OLB)?? But Microsoft Excel and Word object library still exist. In VB6, we can just add outlook library...
0
by: Mads Westen | last post by:
Hi, I'm trying to code a application that can create a new email in Outlook I have coded my project in VS 2003, but now I have upgraded to VS 2005. I can not build my project anymore, I get a...
0
by: alwayssmiling | last post by:
hi all, i want to open a outlook pst file. And i need to check whether that file is already opened or not. you can add oulook pst file using namespace. addstore(object store) ...
2
by: mayo | last post by:
I had a procedure that calls some executable files. When I call .exe files compiled in VB, there's no error but when I try to call the help file which is created in Winhelp 2000, i got an error...
1
by: Sylfelin | last post by:
Hello, If I use Microsoft Outlook 12.0 Object Library (Outlook 2007) COM Object in my application, the custommer must have the outlook 2007 on his computer ? But if i use Microsoft Outlook...
0
by: ram1927 | last post by:
Here is my platform: .net framewrok 1.1 Windows Xp Propfessional MS Office 2007. Visual Studio 2003. Window based application. I did below mentioned steps: 1. Right click on C#...
3
by: davidholmes | last post by:
I need to load a csv file into excel with the shell command. My code works fine as long as excel is not already running but if there is another instance of excel open the shell command opens a new...
6
by: MyWaterloo | last post by:
I am using the following code I found online to send an appointment to Outlook: Private Sub AddAppt_Click() ' Save record first to be sure required fields are filled. DoCmd.RunCommand...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.