473,748 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET & Various Versions Of Outlook

Hi everyone. Having problems with a utility I am writing for work.
The previous IT Director thoughtfully allowed 3 (2000, xp, 2003)
versions of outlook to be installed rather than 1. Now I need the
utility to work for all 3 versions. A previous post suggested
creating objects to detect the version of outlook, which I tried with
success. But, that's as far as I can get. No one out there shows how
to go beyond version detection to actually creating, deleting and
modifying outlook contacts, emails, and appointments. I tried creating
the extra outlook objects I need (shown bellow). So far, VB doesn't
show any errors during programming. When ran, I get an activex error:
"Cannot create Axtivex Component".

Code:
'open outlook application
Private objOutlook As Object = CreateObject("O utlook.Applicat ion")

'store outlook session
Private objNS As Object = CreateObject("O utlook.NameSpac e")
'outlook folder variable
Private objFolder As Object = CreateObject("O utlook.MAPIFold er")
'outlook items variable
Private objItems As Object = CreateObject("O utlook.Items")
'outlook contact variable
Private objContact As Object = CreateObject("O utlook.ContactI tem")
Private objNS As Object = CreateObject("O utlook.NameSpac e") =
objOutlook.Sess ion
doesn't create the activex component. Keep in mind, the utility works
great if I reference a specific version interop assembly. I have been
searching for the past few days without success. Has anyone else had
any success?

Thank you.

Dec 29 '05 #1
3 8288
wizzbangca,
I would recommend upgrading every one to Outlook 2003, which would allow
creating a VSTO 2.0 addin for Outlook. VSTO 2.0 greatly simplifies create
Outlook add-ins in .NET!

If upgrading is not an option, then the "easiest" way is to write your
add-in to the lowest common denominator. Write the add-in to Outlook 2000,
reference Outlook 2000 type library, compile & develop against that.
Alternatively don't reference a type library & use late binding (Object
variables).

| Private objOutlook As Object = CreateObject("O utlook.Applicat ion")
Should work as Outlook.Applica tion is a creatable object.
| 'store outlook session
| Private objNS As Object = CreateObject("O utlook.NameSpac e")
Will fail as Outlook.Namespa ce is NOT a creatable object, you use
objOutlook.GetN amespace to get the namespace object.

| Private objOutlook As Object = CreateObject("O utlook.Applicat ion")
| Private objNS As Object = objOutlook.GetN amespace("MAPI" )
Normally what I do when using Late binding & Outlook (VBScript for example)
is to write a macro in the VBIDE in Outlook (Alt+F11 when the Outlook
Explorer window is open) for intellisense. Then change all the strongly
typed variables to Object. You could probably adopt a similar method for
late binding in VB.NET...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"wizzbangca " <wi********@yah oo.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
| Hi everyone. Having problems with a utility I am writing for work.
| The previous IT Director thoughtfully allowed 3 (2000, xp, 2003)
| versions of outlook to be installed rather than 1. Now I need the
| utility to work for all 3 versions. A previous post suggested
| creating objects to detect the version of outlook, which I tried with
| success. But, that's as far as I can get. No one out there shows how
| to go beyond version detection to actually creating, deleting and
| modifying outlook contacts, emails, and appointments. I tried creating
| the extra outlook objects I need (shown bellow). So far, VB doesn't
| show any errors during programming. When ran, I get an activex error:
| "Cannot create Axtivex Component".
|
| Code:
| 'open outlook application
| Private objOutlook As Object = CreateObject("O utlook.Applicat ion")
|
| 'store outlook session
| Private objNS As Object = CreateObject("O utlook.NameSpac e")
| 'outlook folder variable
| Private objFolder As Object = CreateObject("O utlook.MAPIFold er")
| 'outlook items variable
| Private objItems As Object = CreateObject("O utlook.Items")
| 'outlook contact variable
| Private objContact As Object = CreateObject("O utlook.ContactI tem")
|
|
| Private objNS As Object = CreateObject("O utlook.NameSpac e") =
| objOutlook.Sess ion
| doesn't create the activex component. Keep in mind, the utility works
| great if I reference a specific version interop assembly. I have been
| searching for the past few days without success. Has anyone else had
| any success?
|
| Thank you.
|
Jan 3 '06 #2
objOutlook.GetN amespace
Doesn't work - "Parameter not optional" error.

Jan 12 '06 #3
wizzbangca,
Did you try passing the "MAPI" parameter as I showed:

| Private objOutlook As Object = CreateObject("O utlook.Applicat ion")
| Private objNS As Object = objOutlook.GetN amespace("MAPI" )
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"wizzbangca " <wi********@yah oo.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
| objOutlook.GetN amespace
| Doesn't work - "Parameter not optional" error.
|
Jan 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1522
by: MLH | last post by:
I have an AMP application running on linux server that collects, maintains and serves up image files to web clients. On my LAN (in fact, on the same subnet) I have both the linux box and windoze clients. The window$ boxes are staffed by persons who sometimes email the image files stored on the linux box to various recipients. For simplicity, lets call my linux box L and my windoze box W. Both are nodes on the LAN. Here are the knowns: ...
6
6844
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
5
1773
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS 7.2, Safari and for OS : Win95/98/NT/Me/2000/XP, MacOS 9/10, Linux. I have some problems with browser on different OS. For example i have write a javascript who make a automatic submit when the page is reload.
20
2942
by: wolftor | last post by:
Would anyone be willing to beta test my application for me and give me some feedback? I can give you feedback in exchange (ie. if there are parts you're interested in knowing how it was done) or I can give you a free license if you want to use it. It should install OK but that is part of the problem that needs to be verified on all platforms so that people can just download it in the future, install and use it. It has an mde front...
6
11608
by: JimmyKoolPantz | last post by:
I have been given the task of converting a program from VFP (visual foxpro) to Visual Basic.net. My question is "Is it possible to generate a DBF file Dynamically(at runtime) using Visual Basic.Net?" With all the field properties, such as, field length and type. I'm not sure if this is a stupid quesiton or If I am just over looking something, but I have not found solid information on the internet about this topic. Any useful...
10
10789
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language Aquisition Device (2) Color Aqusition Device (3) Sound Aquistion Device (4) Smell Aquisition Device (5) Touch Aquisition Device (6) Art Aquisition Device
0
2508
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that don't work nearly as well as they should, even for analysts and power users. The reason they haven't reached the masses is because most of the tools are so difficult to use and reveal so little
2
1531
by: =?Utf-8?B?Sk1D?= | last post by:
Will any of the programs in 2007 Office Home & Student work with Office Outlook 2003? Will any of the programs in 2007 Office Home & Student do the same things as in Works 8 Word Processor, like insert Tables, resise Tables, and other things that I can do with Works 8 Word Processor? Thank you! -- JMC
0
2274
by: Roman Optio | last post by:
Hi, I am currently working on a tool to transfer addressbook data such as contacts and organizations between Vondle and Outlook. For those of you who are wondering what Vondle is, it is an online project management toolkit used to support large engineering projects. More information on Vondle can be found at http://www.bricsys.com/vondle/ . The purpose of the tool is to fluently transfer addressbook data between vondle & outlook. I've...
0
8983
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9359
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9310
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.