473,667 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Outlook]add contact item

Hi folks

Does anyone know how to add an object of type ContactItem to an _Items list?
_Items provides an add() method which, however, only accepts a Variant as
parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Regards,
Marcel

Nov 15 '05 #1
4 3759
Hi Marcel
try
Outlook._Contac tItem myContact = objMyContact as Outlook._Contac tItem;
myContact.First Name=firstname
....
myContact.Save( )

"Marcel Stör" <marcel at frightanic dot com> wrote in message
news:3f******** *************@r ead.news.ch.uu. net...
Hi folks

Does anyone know how to add an object of type ContactItem to an _Items list? _Items provides an add() method which, however, only accepts a Variant as
parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Regards,
Marcel

Nov 15 '05 #2
Marcel,
The following site has a number of resources available on programming
Outlook with .NET:

http://www.microeye.com/resources/res_outlookvsnet.htm

Hope this helps
Jay

"Marcel Stör" <marcel at frightanic dot com> wrote in message
news:3f******** *************@r ead.news.ch.uu. net...
Hi folks

Does anyone know how to add an object of type ContactItem to an _Items list? _Items provides an add() method which, however, only accepts a Variant as
parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Regards,
Marcel

Nov 15 '05 #3
Stefan wrote:
Hi Marcel
try
Outlook._Contac tItem myContact = objMyContact as Outlook._Contac tItem;
myContact.First Name=firstname
...
myContact.Save( )


According to the language reference this would save the contact item in its
default folder. However, the item doesn't need to be stored in the contacts
folder but rather in one specific public folder (the MAPIFolder object in my
pseudo code).
Hi folks

Does anyone know how to add an object of type ContactItem to an
_Items list? _Items provides an add() method which, however, only
accepts a Variant as parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Regards,
Marcel
Nov 15 '05 #4
Marcel Stör wrote:
Hi folks

Does anyone know how to add an object of type ContactItem to an
_Items list? _Items provides an add() method which, however, only
accepts a Variant as parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Then I need to invoke move(MAPIFolder ). That's all.

Regards,
Marcel
Nov 15 '05 #5

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

Similar topics

3
1413
by: Borza Paul Valentin | last post by:
Hello, I am a beginner in outlook interop. But i want to create an outlook add in, which can be able to add some menu items, but most imprtant I want it to be able to read the source of the emails, when a users is viewing them. Can anyone help? Vali
3
1329
by: Pieter Coucke | last post by:
Hi, I developped some time ago an Outlook Add In (VB.NET 2005) that worked fine during several months with all the users. Suddenly, 2 weeks ago it stopped working for one of the users. The administrator desinstalled it and installed it again, but that didn't work. i did the same, desinstalled it, rebooted, removed everything I could find about it in the registry of file system (nothing in both cases), reinstalled it, but still not...
6
1683
by: Pieter | last post by:
Hi, I developed an Outlook Add In (VB.NET 2005, for Outlook 2003) that sometimes suddenly stops loading. I've put everywhere in the code Exception Handlers, but no Exception is catched. it seems that other add ins aren't loaded afterwarths (nod32). Does anybody know a way to find out why an outlook add could do this? and find out after the problem what caused the problem?
2
5130
by: charliej2001 | last post by:
Hi all Im copying details from an Outlook contact address book into an Access database. Originally I was only copying about 10 fields across, using the the following method, with a line of code for each piece of data being copied TempContactRST.AddNew TempContactRST!FirstName = c.FirstName TempContactRST!LastName = c.LastName
1
2162
by: kannan | last post by:
Hi, I am trying to loop through outlook contact address and display in messagebox. I have used following code: Outlook._Application olApp = new Outlook.ApplicationClass(); Outlook._NameSpace olNs = olApp.GetNamespace("MAPI"); Outlook.MAPIFolder oContacts = olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Items oItems = oContacts.Items;
0
986
by: =?Utf-8?B?ZGFuaWtlbmFu?= | last post by:
Hi, I have a managed outlook add-in that loads with a shim. One of the add-in dialogs contains a ListView (in details mode) that needs xp-theming so that it shows the groups. I am using microsoft's EnableThemingInScope class (http://support.microsoft.com/kb/830033) arround the dialog and the group do show up.
1
4736
by: Marc | last post by:
Hello, Am getting acquainted with VSTO and Visual Studio. I have been really successful adding references to the PIAs for Word, Outlook, Excel, etc. to Console applications and VB applications. However, I also wanted to investigate add-ins (specifically for Outlook). I downloaded VBTO 2007 SE and installed it, and now when I start Visual Studio I see project templates for, e.g. Outlook Add-In.
5
2206
by: John | last post by:
Hi I have an Outlook add-in solution which includes a setup project. If I install the Outlook add-in by right clicking on the setup project and sleeting Install then the add-in gets installed fine in Outlook. However if I use the setup generated in the setup project Release folder then even though setup runs and finishes, the Outlook Add-in does not appear in Outlook. What is the problem and how can I fix it? Thanks
1
1625
by: GeorgeSonq | last post by:
Hello, I'm developing an Outlook Add-in and I'm trying to modify the attachments of an Outlook item before it's being sent. I'm able to successfully do it with a MailItem, but I wasn’t able to do it with a MeetingItem. Consider the following simple examples: /* removing the first attachment from MailItem - works just fine */ void OutlookApplication_ItemSend(object Item, ref bool Cancel) { Outlook.MailItem OutlookMailItem = Item as...
0
1566
by: swdesh | last post by:
Hello I am using VSTO 2005 SE for creating outllok add-in. I am facing a problem. My outlook events are not getting fired. I am also using System Tray Icon class for creating Icon in Task bar. If i comment the code for creating Tray Icon then it is working fine. Here is my code Public Class AddIn Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup Call initializeValue()...
0
8457
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
8365
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8788
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
8563
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
7390
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
6203
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...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1778
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.