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

Outlook 2003: Personalized form with VB-Script and VB.NET



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 30th 07, 09:10 AM posted to microsoft.public.outlook.program_forms
Oskar Vaia
external usenet poster
 
Posts: 29
Default Outlook 2003: Personalized form with VB-Script and VB.NET

Hi,

in my own personalized task-form i have amongst others some VB-Script-code
for the "Item_CustomPropertyChange"-event.
This event will triggered when i insert or change values on my custom-fields
on the personalized task-form and this is right.

An application, which i have developed with VB.NET 2005 inserts or changes
values on the custom-fields on the personalized task-form, too.

Here the VB.NET-code:
---
Dim myOlApp As New Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myitem As Outlook.TaskItem
myNamespace = myOlApp.GetNamespace("MAPI")
myitem = myNamespace.GetItemFromID(strEntryID, objStoreID)
myitem.UserProperties("MB1").Value = True
myitem.Save()
myNamespace = Nothing
myOlApp = Nothing
---

Now my question:
When my VB.NET-application inserts or changes values on the custom-fields on
the personalized task-form, then the VB-Script code behind the taskform will
triggered, too. It is possible to prevent this comportment?
The VB-Script code behind the taskform should only triggered when i insert
or change values on my taskform directly.

thx & bye

Oskar

Ads
  #2  
Old October 30th 07, 01:46 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Outlook 2003: Personalized form with VB-Script and VB.NET

Would the user normally be able to change MB1 manually? Does the VBScript code need to handle any changes in MB1?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Oskar Vaia" wrote in message ...
Hi,

in my own personalized task-form i have amongst others some VB-Script-code
for the "Item_CustomPropertyChange"-event.
This event will triggered when i insert or change values on my custom-fields
on the personalized task-form and this is right.

An application, which i have developed with VB.NET 2005 inserts or changes
values on the custom-fields on the personalized task-form, too.

Here the VB.NET-code:
---
Dim myOlApp As New Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myitem As Outlook.TaskItem
myNamespace = myOlApp.GetNamespace("MAPI")
myitem = myNamespace.GetItemFromID(strEntryID, objStoreID)
myitem.UserProperties("MB1").Value = True
myitem.Save()
myNamespace = Nothing
myOlApp = Nothing
---

Now my question:
When my VB.NET-application inserts or changes values on the custom-fields on
the personalized task-form, then the VB-Script code behind the taskform will
triggered, too. It is possible to prevent this comportment?
The VB-Script code behind the taskform should only triggered when i insert
or change values on my taskform directly.

thx & bye

Oskar

  #3  
Old October 30th 07, 06:12 PM posted to microsoft.public.outlook.program_forms
Oskar Vaia
external usenet poster
 
Posts: 29
Default Outlook 2003: Personalized form with VB-Script and VB.NET

Hi Sue,

yes, the user normally would be able to change MB1 manually and the VBScript
code needs to handle any changes in MB1, too.

thx and bye

Oskar


"Sue Mosher [MVP-Outlook]" schrieb im Newsbeitrag
...
Would the user normally be able to change MB1 manually? Does the VBScript
code need to handle any changes in MB1?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Oskar Vaia" wrote in message
...
Hi,

in my own personalized task-form i have amongst others some VB-Script-code
for the "Item_CustomPropertyChange"-event.
This event will triggered when i insert or change values on my
custom-fields
on the personalized task-form and this is right.

An application, which i have developed with VB.NET 2005 inserts or changes
values on the custom-fields on the personalized task-form, too.

Here the VB.NET-code:
---
Dim myOlApp As New Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myitem As Outlook.TaskItem
myNamespace = myOlApp.GetNamespace("MAPI")
myitem = myNamespace.GetItemFromID(strEntryID, objStoreID)
myitem.UserProperties("MB1").Value = True
myitem.Save()
myNamespace = Nothing
myOlApp = Nothing
---

Now my question:
When my VB.NET-application inserts or changes values on the custom-fields
on
the personalized task-form, then the VB-Script code behind the taskform
will
triggered, too. It is possible to prevent this comportment?
The VB-Script code behind the taskform should only triggered when i insert
or change values on my taskform directly.

thx & bye

Oskar


  #4  
Old October 30th 07, 08:28 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Outlook 2003: Personalized form with VB-Script and VB.NET

In that scenario, what you could do is set another property value on the form (BillingInformation or Mileage or a custom property) and allow the script to run only when that property is not a certain value. Like this:

1) Add-in sets "check" property value to "stop" value. [could be text, Boolean, numeric, depending on what property you use]
2) Add-in changes MB1.
3) CustomPropertyChange event fires, looks at value of "check" property, and runs no more code for MB1.
4) Add-in sets "check" property to "go" value.

Thus the CustomPropertyChange event would still fire, of course -- you can't prevent that -- but the script code would run only on the "go" value.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Oskar Vaia" wrote in message ...
Hi Sue,

yes, the user normally would be able to change MB1 manually and the VBScript
code needs to handle any changes in MB1, too.

thx and bye

Oskar


"Sue Mosher [MVP-Outlook]" schrieb im Newsbeitrag
...
Would the user normally be able to change MB1 manually? Does the VBScript
code need to handle any changes in MB1?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Oskar Vaia" wrote in message
...
Hi,

in my own personalized task-form i have amongst others some VB-Script-code
for the "Item_CustomPropertyChange"-event.
This event will triggered when i insert or change values on my
custom-fields
on the personalized task-form and this is right.

An application, which i have developed with VB.NET 2005 inserts or changes
values on the custom-fields on the personalized task-form, too.

Here the VB.NET-code:
---
Dim myOlApp As New Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myitem As Outlook.TaskItem
myNamespace = myOlApp.GetNamespace("MAPI")
myitem = myNamespace.GetItemFromID(strEntryID, objStoreID)
myitem.UserProperties("MB1").Value = True
myitem.Save()
myNamespace = Nothing
myOlApp = Nothing
---

Now my question:
When my VB.NET-application inserts or changes values on the custom-fields
on
the personalized task-form, then the VB-Script code behind the taskform
will
triggered, too. It is possible to prevent this comportment?
The VB-Script code behind the taskform should only triggered when i insert
or change values on my taskform directly.

thx & bye

Oskar


  #5  
Old October 31st 07, 10:34 AM posted to microsoft.public.outlook.program_forms
Oskar Vaia
external usenet poster
 
Posts: 29
Default Outlook 2003: Personalized form with VB-Script and VB.NET

Hi Sue,

many thx for the tip. I have resolved the problem in similar way.
I set a global variable in the item_open event. This event only fires if i
open the task in outlook and not when i sets values on the task across the
Add-In.

bye

Oskar

 




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
Exchange 2003/Outlook 2003: VBScript-Error in personalized form Oskar Vaia Outlook - Using Forms 2 October 20th 07 08:49 AM
Personalized mail merge using contract groups iaconmi1 Outlook - Using Contacts 2 August 18th 07 12:20 PM
it is possible to clear the form cache of Outlook via logon script Yahawa Outlook and VBA 1 November 30th 06 05:24 PM
Stript Outlook 2003 How save and exit a cusomized form ising a script news.microsoft.com Outlook and VBA 5 September 20th 06 12:11 AM
Outlook form with VB script wont work Hellstern Outlook - Using Forms 1 March 31st 06 03:21 PM


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