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 » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Mail form VB code.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 18th 06, 01:50 PM posted to microsoft.public.outlook.program_forms
T-rev
external usenet poster
 
Posts: 23
Default Mail form VB code.

Have you a VB snippet I could use please.
Problem is I have a published form to a folder. I can add to the
messageBody, or display buttons based on messageProperties. But I need to
get access to mapi custom properties which I have placed on the message.

The don't seem to be in userProperties or itemProperties, I know they are on
the mapi object as I placed them there and can see them on using outlookSpy.

In the form designed is there any way of using
If Item.MapiObject ("ExampleProperty") = TRUE Then
strBody = strBody & "Property Present"
End If

Item.Body = strBody

Thanks for your help.


Ads
  #2  
Old September 18th 06, 03:32 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Mail form VB code.

Look on your form's All Fields page. Do your custom properties appear in the User-defined Fields in This Item list? If so, then you should be able to access them through the UserProperties syntax. If that is not working for you, show a code snippet.

--
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

"T-rev" wrote in message ...
Have you a VB snippet I could use please.
Problem is I have a published form to a folder. I can add to the
messageBody, or display buttons based on messageProperties. But I need to
get access to mapi custom properties which I have placed on the message.

The don't seem to be in userProperties or itemProperties, I know they are on
the mapi object as I placed them there and can see them on using outlookSpy.

In the form designed is there any way of using
If Item.MapiObject ("ExampleProperty") = TRUE Then
strBody = strBody & "Property Present"
End If

Item.Body = strBody

Thanks for your help.


  #3  
Old September 19th 06, 01:27 PM posted to microsoft.public.outlook.program_forms
T-rev
external usenet poster
 
Posts: 23
Default Mail form VB code.

No the properties do not exist in this list, these are userProperties added
to a form. If I add a property to this list it appears on the form
description and userProperties fields which we do not store in our
messageStore. Basically I am writing a form which is to look at properties
most of which are fine ie.

Sub StampDate()

strBody = Item.Body

strBody = Now() & vbCrLf & vbCrLf & strBody

strBody = Item.MessageClass & strBody

If Item.UserProperties.Count 0 Then

For intCount = 1 To Item.UserProperties.Count

strBody = vbCrLf & Item.UserProperties.Item(intCount).Name & strBody

strBody = vbCrLf & Item.UserProperties.Item(intCount).Value & strBody

Next

End If

Item.Body = strBody

End Sub

Properties which are normally on the mailItem are fine eg. messageClass, but
if there are custom named Properties on the mapiObject - eg. property 0x8001
propertyName 'Cached'

If I search through all the userProperties or itemProperties it is not
present there. Now if I add a property called Cached to the form, I can
then see it in the formDescription and in the UserProperties field on the
mapiObject. Which means I would have to know the structure of the
UserProperties in order to fill this property field in ahead of time. have
you any code snippets of how to get access to properties within the
mapiObject.

Eg. if you browse(MailItem.MapiObject) I can see the properties on the item
that I am concerned with - some custom ones placed on each item by the
messageStore. A general example would be PR_RTF_IN_SYNC on the mapiObject -
how would I obtain this property value from the mapiObject within the form.

Thanks for your help.

"Sue Mosher [MVP-Outlook]" wrote in message
...

Look on your form's All Fields page. Do your custom properties appear in the
User-defined Fields in This Item list? If so, then you should be able to
access them through the UserProperties syntax. If that is not working for
you, show a code snippet.

--
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

"T-rev" wrote in message
...
Have you a VB snippet I could use please.
Problem is I have a published form to a folder. I can add to the
messageBody, or display buttons based on messageProperties. But I need to
get access to mapi custom properties which I have placed on the message.

The don't seem to be in userProperties or itemProperties, I know they are
on
the mapi object as I placed them there and can see them on using
outlookSpy.

In the form designed is there any way of using
If Item.MapiObject ("ExampleProperty") = TRUE Then
strBody = strBody & "Property Present"
End If

Item.Body = strBody

Thanks for your help.




  #4  
Old September 19th 06, 04:42 PM posted to microsoft.public.outlook.program_forms
T-rev
external usenet poster
 
Posts: 23
Default Mail form VB code.

thanks - userProperties now contain items which I have added from the folder
list, - the values of which seem to be got correctly from the mapiObject.

thanks for your help.

For some reason I was having problems with numbers referencing ULONGs
instead of integers but this has now resolved itself.

"Sue Mosher [MVP-Outlook]" wrote in message
...
Look on your form's All Fields page. Do your custom properties appear in the
User-defined Fields in This Item list? If so, then you should be able to
access them through the UserProperties syntax. If that is not working for
you, show a code snippet.

--
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

"T-rev" wrote in message
...
Have you a VB snippet I could use please.
Problem is I have a published form to a folder. I can add to the
messageBody, or display buttons based on messageProperties. But I need to
get access to mapi custom properties which I have placed on the message.

The don't seem to be in userProperties or itemProperties, I know they are
on
the mapi object as I placed them there and can see them on using
outlookSpy.

In the form designed is there any way of using
If Item.MapiObject ("ExampleProperty") = TRUE Then
strBody = strBody & "Property Present"
End If

Item.Body = strBody

Thanks for your help.




 




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
Outlook Form Command Button Code Tipcie Outlook and VBA 1 July 26th 06 03:26 PM
Outlook Language Code Page from MAPI C++ form m3driver Add-ins for Outlook 3 July 7th 06 06:23 PM
why write some code in form then the reading pane can't display [email protected] Outlook - Using Forms 1 July 4th 06 03:01 AM
why write some code in form then the reading pane can't display [email protected] Outlook - Using Forms 1 June 19th 06 01:57 PM
Need code for appointment form Colin Coady Outlook - Using Forms 0 January 18th 06 02:21 PM


All times are GMT +1. The time now is 05:47 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.