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

Region UserProperties



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 14th 07, 02:06 PM posted to microsoft.public.outlook.program_forms
Vbasiccode
external usenet poster
 
Posts: 14
Default Region UserProperties

I have created a new Region (seperate type). I now want ot communicate with
that form from an outside windows application. when i run the code shown
below, i get an error because it can't find the user properties that the code
is requesting. However if i open up the Account form then the actual new
region form, then suddenly all the user properties are available.

Is their a way to communicate with the regions (seperate type) User
properties (UDFs) with out having to open the matching form in out look
itself?

Dim app As New Outlk.Application
Dim olns As Outlk.NameSpace = app.GetNamespace("MAPI")
Dim olFolders As Outlk.Folders = olns.Session.Folders
Dim RootFolder As Outlk.Folder = olFolders("Business Contact Manager")
Dim AccountsFldr As Outlk.Folder = RootFolder.Folders("Accounts")
Dim newAccount As Outlk.ContactItem = Nothing
Dim userProp As Outlk.UserProperty = Nothing


newAccount = AccountsFldr.Items.Find("[Subject]='Account2 Name'")

'the error occures on this line because it cannot find the UDF Called
Carrier
userProp = newAccount.UserProperties.Find("Carrier")





  #2  
Old May 14th 07, 02:20 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Region UserProperties

The symptoms suggest that the property doesn't exist on the item yet. You'll need to add it using the UserProperties.Add method if it doesn't already exist on the individual item.

This isn't a problem when the user opens the item, because opening it invokes the form region, which causes the necessary properties to be created.
--
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

"Vbasiccode" wrote in message ...
I have created a new Region (seperate type). I now want ot communicate with
that form from an outside windows application. when i run the code shown
below, i get an error because it can't find the user properties that the code
is requesting. However if i open up the Account form then the actual new
region form, then suddenly all the user properties are available.

Is their a way to communicate with the regions (seperate type) User
properties (UDFs) with out having to open the matching form in out look
itself?

Dim app As New Outlk.Application
Dim olns As Outlk.NameSpace = app.GetNamespace("MAPI")
Dim olFolders As Outlk.Folders = olns.Session.Folders
Dim RootFolder As Outlk.Folder = olFolders("Business Contact Manager")
Dim AccountsFldr As Outlk.Folder = RootFolder.Folders("Accounts")
Dim newAccount As Outlk.ContactItem = Nothing
Dim userProp As Outlk.UserProperty = Nothing


newAccount = AccountsFldr.Items.Find("[Subject]='Account2 Name'")

'the error occures on this line because it cannot find the UDF Called
Carrier
userProp = newAccount.UserProperties.Find("Carrier")





  #3  
Old May 14th 07, 02:51 PM posted to microsoft.public.outlook.program_forms
Vbasiccode
external usenet poster
 
Posts: 14
Default Region UserProperties


so should i replace the line
userProp = newAccount.UserProperties.Find("Carrier")
with
userProp = itemContact.UserProperties.Add("Carrier", olText)

for each of the properties in the Form Region?

"Sue Mosher [MVP-Outlook]" wrote:

The symptoms suggest that the property doesn't exist on the item yet. You'll need to add it using the UserProperties.Add method if it doesn't already exist on the individual item.

This isn't a problem when the user opens the item, because opening it invokes the form region, which causes the necessary properties to be created.
--
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

"Vbasiccode" wrote in message ...
I have created a new Region (seperate type). I now want ot communicate with
that form from an outside windows application. when i run the code shown
below, i get an error because it can't find the user properties that the code
is requesting. However if i open up the Account form then the actual new
region form, then suddenly all the user properties are available.

Is their a way to communicate with the regions (seperate type) User
properties (UDFs) with out having to open the matching form in out look
itself?

Dim app As New Outlk.Application
Dim olns As Outlk.NameSpace = app.GetNamespace("MAPI")
Dim olFolders As Outlk.Folders = olns.Session.Folders
Dim RootFolder As Outlk.Folder = olFolders("Business Contact Manager")
Dim AccountsFldr As Outlk.Folder = RootFolder.Folders("Accounts")
Dim newAccount As Outlk.ContactItem = Nothing
Dim userProp As Outlk.UserProperty = Nothing


newAccount = AccountsFldr.Items.Find("[Subject]='Account2 Name'")

'the error occures on this line because it cannot find the UDF Called
Carrier
userProp = newAccount.UserProperties.Find("Carrier")






  #4  
Old May 14th 07, 03:13 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Region UserProperties

Not quite. You should keep the statement you already have, but test whether userProp Is Nothing before you do anything with it. If it is Nothing, then add the property.

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

"Vbasiccode" wrote in message ...

so should i replace the line
userProp = newAccount.UserProperties.Find("Carrier")
with
userProp = itemContact.UserProperties.Add("Carrier", olText)

for each of the properties in the Form Region?

"Sue Mosher [MVP-Outlook]" wrote:

The symptoms suggest that the property doesn't exist on the item yet. You'll need to add it using the UserProperties.Add method if it doesn't already exist on the individual item.

This isn't a problem when the user opens the item, because opening it invokes the form region, which causes the necessary properties to be created.



"Vbasiccode" wrote in message ...
I have created a new Region (seperate type). I now want ot communicate with
that form from an outside windows application. when i run the code shown
below, i get an error because it can't find the user properties that the code
is requesting. However if i open up the Account form then the actual new
region form, then suddenly all the user properties are available.

Is their a way to communicate with the regions (seperate type) User
properties (UDFs) with out having to open the matching form in out look
itself?

Dim app As New Outlk.Application
Dim olns As Outlk.NameSpace = app.GetNamespace("MAPI")
Dim olFolders As Outlk.Folders = olns.Session.Folders
Dim RootFolder As Outlk.Folder = olFolders("Business Contact Manager")
Dim AccountsFldr As Outlk.Folder = RootFolder.Folders("Accounts")
Dim newAccount As Outlk.ContactItem = Nothing
Dim userProp As Outlk.UserProperty = Nothing


newAccount = AccountsFldr.Items.Find("[Subject]='Account2 Name'")

'the error occures on this line because it cannot find the UDF Called
Carrier
userProp = newAccount.UserProperties.Find("Carrier")






 




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
Communicate with a Form Region Vbasiccode Outlook - Using Forms 5 May 9th 07 10:51 PM
Country/Region in Contacts Jack Outlook - General Queries 3 March 24th 07 12:00 PM
forward an attachment with form region Nikolas Outlook - Using Forms 4 March 16th 07 10:44 AM
only one instance of form region is displayed Nikolas Outlook - Using Forms 4 October 6th 06 03:37 PM
BLANK REGION/COUNTRY LIST ed Outlook - Using Contacts 1 May 30th 06 09:50 AM


All times are GMT +1. The time now is 12:25 PM.


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.