Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   Exchange 2003/Outlook 2003: VBScript-Error in personalized form (http://www.outlookbanter.com/outlook-using-forms/59382-exchange-2003-outlook-2003-vbscript.html)

Oskar Vaia October 19th 07 05:44 PM

Exchange 2003/Outlook 2003: VBScript-Error in personalized form
 
Hi,

i'm developing a new personalized taskform.
The form has worked without problems until today morning.

Now on passing the follow code-section
---
sub commandbutton6_click()
Dim CB5Caption
CB5Source = 1

Select Case CB5Caption
Case "1. Mahnstufe"
item.userproperties("Mahnung1").Value = True
item.userproperties("MB1").Value = date
item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB1").Visible =
True
item.userproperties("aktMahnstufe").Value = "1"
Getinspector.ModifiedFormPages("Inkassi").Controls ("CommandButton6").Caption
= "2. Mahnstufe"
Mahnbrieferstellung
Case "2. Mahnstufe"
item.userproperties("Mahnung2").Value = True
item.userproperties("MB2").Value = date
Item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB2").Visible =
True
item.userproperties("aktMahnstufe").Value = "2"
GetInspector.ModifiedFormPages("Inkassi").Controls ("CommandButton6").Caption
= "3. Mahnstufe"
Mahnbrieferstellung
End Select

CB5Source = 0
Item.Close olSave
end sub
---

i receive the following error

Objekt required: '[object]'

In the debugger the error said something like this:

Microsoft Office Outlook: You don't have the necessary authorization to
achieve the operation.

I simply did not understand why the code surprisedly doesn't work, if until
tomorrow it worked without problems.
Can someone please help me to resolve this problem, before i get crazy? ;-)

The error comes on this position:
item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB1").Visible =
True

thx & bye

Oskar


Sue Mosher [MVP-Outlook] October 19th 07 07:00 PM

Exchange 2003/Outlook 2003: VBScript-Error in personalized form
 
That statement contains references two objects. Is there a page named Test visible on the form in run mode? A control named LabelMB1 on that page? A good troubleshooting practice would involve rewriting that statement into two statements, with only one object variable returned in each, so you can know for certain which one is causing the problem.
--
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,

i'm developing a new personalized taskform.
The form has worked without problems until today morning.

Now on passing the follow code-section
---
sub commandbutton6_click()
Dim CB5Caption
CB5Source = 1

Select Case CB5Caption
Case "1. Mahnstufe"
item.userproperties("Mahnung1").Value = True
item.userproperties("MB1").Value = date
item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB1").Visible =
True
item.userproperties("aktMahnstufe").Value = "1"
Getinspector.ModifiedFormPages("Inkassi").Controls ("CommandButton6").Caption
= "2. Mahnstufe"
Mahnbrieferstellung
Case "2. Mahnstufe"
item.userproperties("Mahnung2").Value = True
item.userproperties("MB2").Value = date
Item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB2").Visible =
True
item.userproperties("aktMahnstufe").Value = "2"
GetInspector.ModifiedFormPages("Inkassi").Controls ("CommandButton6").Caption
= "3. Mahnstufe"
Mahnbrieferstellung
End Select

CB5Source = 0
Item.Close olSave
end sub
---

i receive the following error

Objekt required: '[object]'

In the debugger the error said something like this:

Microsoft Office Outlook: You don't have the necessary authorization to
achieve the operation.

I simply did not understand why the code surprisedly doesn't work, if until
tomorrow it worked without problems.
Can someone please help me to resolve this problem, before i get crazy? ;-)

The error comes on this position:
item.GetInspector.ModifiedFormPages("Test").Contro ls("LabelMB1").Visible =
True

thx & bye

Oskar


Oskar Vaia October 20th 07 08:49 AM

Exchange 2003/Outlook 2003: VBScript-Error in personalized form
 
Hi Sue,

thx for your tip.
I have found the error and it was so a stupid error.

Look he
---
Sub Item_CustomPropertyChange(ByVal Name)
if CB5Source = 0 then

Dim RetMsgBox
Select Case Name
Case "Mahnung1"
.... End Select
end if
item.close 0
end sub
---

I have set the "item.close 0"-command on the wrong position and so my item
were always closed.

thx very much for your good tip!

bye, Oskar



All times are GMT +1. The time now is 12:10 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-2006 OutlookBanter.com