How to create custom Field for emails programmatically 
Author Message
 How to create custom Field for emails programmatically

Hi,

  Our Outlook solution requires a custom field that will
be added to the users' "Inbox Folder" programatically.

  Is it possible to have an outlook add-in which is
registered through InstallShield do the above ?

Thank you very much for any tips, pointers,

Best Regards,
ANJAN. B



Sun, 01 Aug 2004 09:46:46 GMT  
 How to create custom Field for emails programmatically
Yes, the addin can use MailItem.UserProperties.Add to add the property to an item you create in the Inbox. That creates it in the folder as well. You then discard the MailItem.

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com

Quote:

> Hi,

>   Our Outlook solution requires a custom field that will
> be added to the users' "Inbox Folder" programatically.

>   Is it possible to have an outlook add-in which is
> registered through InstallShield do the above ?

> Thank you very much for any tips, pointers,

> Best Regards,
> ANJAN. B



Sun, 01 Aug 2004 10:25:53 GMT  
 How to create custom Field for emails programmatically
Hi Sue,

  Thank you.

  I tried your suggestion in the VB Editor attached to
Outlook 2000. Unfortunately, my code doesn't seem to work.
What I did was to send an email from a different account
which comes to the Inbox.

Here is the Inbox Item Add Handler.

============================
01 Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
02     Debug.Print "hi there from objInboxItems_ItemAdd"
03     Dim myUserProperty As UserProperty
04
05     Set myUserProperty = Item.UserProperties _
06     .Add("Test", olNumber, True, RAWFORMAT)
07     Item.UserProperties(1).Value = "66"
08     Set Item = Nothing
09 End Sub

============================

Is it because
a) of   "Set Item = Nothing" in Line 09 ?
b) I had already defined a Field called "Test" in the
Inbox folder.

P.S : I created a custom Mail form with a text item and
bound it to the custom field "Test". When I sent a mail to
myself using this form, I am able to see the Custom Field
values in my Inbox Folder.

Thank you very much for your inputs,

Best Regards,
ANJAN. B

Quote:
>-----Original Message-----
>Yes, the addin can use MailItem.UserProperties.Add to add

the property to an item you create in the Inbox. That
creates it in the folder as well. You then discard the
MailItem.
Quote:

>--
>Sue Mosher, Outlook MVP
>   Outlook and Exchange Solutions
>   at http://www.slipstick.com




Quote:
>> Hi,

>>   Our Outlook solution requires a custom field that
will
>> be added to the users' "Inbox Folder" programatically.

>>   Is it possible to have an outlook add-in which is
>> registered through InstallShield do the above ?

>> Thank you very much for any tips, pointers,

>> Best Regards,
>> ANJAN. B

>.



Mon, 02 Aug 2004 04:29:40 GMT  
 How to create custom Field for emails programmatically
I don't understand what you're doing. Adding a field to a folder is a one-time operation in a procedure that your program could run at startup, not something that you'd run in the ItemAdd event handler.

Also, in line 7, since you've already obtained a myUserProperty object, you should use it to set the value. You can't depend on the index to be 1:

07     myUserProperty.Value = "66"

In any case, you didn't provide any specifics on what didn't work.

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com

Quote:

> Hi Sue,

>   Thank you.

>   I tried your suggestion in the VB Editor attached to
> Outlook 2000. Unfortunately, my code doesn't seem to work.
> What I did was to send an email from a different account
> which comes to the Inbox.

> Here is the Inbox Item Add Handler.

> ============================
> 01 Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
> 02     Debug.Print "hi there from objInboxItems_ItemAdd"
> 03     Dim myUserProperty As UserProperty
> 04
> 05     Set myUserProperty = Item.UserProperties _
> 06     .Add("Test", olNumber, True, RAWFORMAT)
> 07     Item.UserProperties(1).Value = "66"
> 08     Set Item = Nothing
> 09 End Sub

> ============================

> Is it because
> a) of   "Set Item = Nothing" in Line 09 ?
> b) I had already defined a Field called "Test" in the
> Inbox folder.

> P.S : I created a custom Mail form with a text item and
> bound it to the custom field "Test". When I sent a mail to
> myself using this form, I am able to see the Custom Field
> values in my Inbox Folder.

> Thank you very much for your inputs,

> Best Regards,
> ANJAN. B

> >-----Original Message-----
> >Yes, the addin can use MailItem.UserProperties.Add to add
> the property to an item you create in the Inbox. That
> creates it in the folder as well. You then discard the
> MailItem.



> >> Hi,

> >>   Our Outlook solution requires a custom field that
> will
> >> be added to the users' "Inbox Folder" programatically.

> >>   Is it possible to have an outlook add-in which is
> >> registered through InstallShield do the above ?



Mon, 02 Aug 2004 04:43:19 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to programmatically create a custom field

2. Help::Custom Field in programmatically creating new item

3. programmatically setting custom field

4. Custom Field - Sender EMAIL - Help

5. Creating a custom email using ASP/CDO...

6. Programmatically creating controls from a field list

7. Creating fields programmatically

8. Creating Text Fields Programmatically

9. programmatically create forms / ADO field properties

10. create custom icon,custom combobox in custom toolbar

11. create custom icon,custom combobox(to insert values)in custom toolbar

12. how to create a custom field in a specific folder with using VBA

 

 
Powered by phpBB® Forum Software