A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Using C# to create a user-defined field?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 21st 07, 01:24 PM posted to microsoft.public.outlook.program_addins
Mikael
external usenet poster
 
Posts: 1
Default Using C# to create a user-defined field?

Hi!


I am coding a solution that has a function to sync it's database with
Outlook. I use a User-Defined Field to keep track of "my" items and it works
great. BUT - I can not find a way to add the user-defined field to the
folder programmatically. If an app is to be distributet widely I can't ask
my users to do this by hand.

I have noticed that som apps (like Skype) has added user-defined fields
automatically, so there has to be a way - do you know or could you point me
in the right direction? I'm coding in C# and Visual Studio 2005.

Regards
Mikael
Sweden

(I was unsure if this should be published in Interop or Program_AddIns)


Ads
  #2  
Old March 21st 07, 01:40 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Using C# to create a user-defined field?

Answered in Interop, although this is a better group for a question like
that.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mikael" wrote in message
...
Hi!


I am coding a solution that has a function to sync it's database with
Outlook. I use a User-Defined Field to keep track of "my" items and it
works great. BUT - I can not find a way to add the user-defined field to
the folder programmatically. If an app is to be distributet widely I can't
ask my users to do this by hand.

I have noticed that som apps (like Skype) has added user-defined fields
automatically, so there has to be a way - do you know or could you point
me in the right direction? I'm coding in C# and Visual Studio 2005.

Regards
Mikael
Sweden

(I was unsure if this should be published in Interop or Program_AddIns)



  #3  
Old March 23rd 07, 07:01 PM posted to microsoft.public.outlook.program_addins
j
external usenet poster
 
Posts: 109
Default Using C# to create a user-defined field?

If u want add fields to folder, u should create mailItem fill it with
properties and move to folder, that's all.

  #4  
Old March 23rd 07, 07:17 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Using C# to create a user-defined field?

If u want add fields to folder, u should create mailItem fill it with
properties and move to folder, that's all.


That would be totally ineffective. Moving an item to a folder has no effect whatsoever on the fields defined in that folder.

To define a field in a folder in versions before Outlook 2007, use the MAPIFolder.Items.Add method to create a new item in the folder (a post item if it's a mail/post folder). Then use the item's UserProperties.Add method to create the property on the item, setting the third parameter to True. Finally, delete this new item, which is no longer needed.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering On User Defined Field Alan Outlook - General Queries 1 January 18th 07 09:17 PM
How to create a user-defined field in vsto [email protected] Outlook - Using Forms 4 September 18th 06 03:55 PM
User Defined Field Initial Value Matt Outlook and VBA 1 May 6th 06 06:54 AM
How do I rename user defined field names? Sue Mosher [MVP-Outlook] Outlook - Using Contacts 1 January 19th 06 03:13 AM
Referencing a User-Defined Field Chaplain Doug Outlook - Using Forms 1 January 13th 06 03:54 PM


All times are GMT +1. The time now is 11:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.