(Msg. 1) Posted: Wed May 06, 2009 12:59 pm
Post subject: Outlook 2003 Custom Form Error Handling Archived from groups: microsoft>public>outlook>program_forms (more info?)
I would like to include some error handling in my VBScript on my custom form.
I've tried the On Error GoTo statement, but I keep getting a Syntax Error.
Then I've tried
On Error Resume Next
.... code to check ...
If Err <> 0 Then
.... do stuff
End If
But my error catching code does not seem to execute (I'm pretty sure my code
to check has a runtime error in it)
Basically, I have the following procedure call in one of my events:
Item.GetInspector ...
I know that it fails sometimes. I'd like to catch the error if my statement
fails and handle it.
(Msg. 2) Posted: Wed May 06, 2009 4:08 pm
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
VBScript does not support On Error GoTo. What you're doing with On Error
Resume Next and Err <> 0 is a good approach.
Item.GetInspector should never fail in a custom form. But if you're worried
that it might, this is the way to handle it:
On Error Resume Next
Set insp = Item.GetInspector
If insp Is Nothing Then
' there is no Inspector
Else
' do something with insp
End If
"Maui80" <Maui80 RemoveThis @discussions.microsoft.com> wrote in message
news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
>I would like to include some error handling in my VBScript on my custom
>form.
> I've tried the On Error GoTo statement, but I keep getting a Syntax Error.
> Then I've tried
> On Error Resume Next
> ... code to check ...
> If Err <> 0 Then
> ... do stuff
> End If
> But my error catching code does not seem to execute (I'm pretty sure my
> code
> to check has a runtime error in it)
>
> Basically, I have the following procedure call in one of my events:
> Item.GetInspector ...
> I know that it fails sometimes. I'd like to catch the error if my
> statement
> fails and handle it.
>
> Any suggestions?
> Thanks in advance!
(Msg. 3) Posted: Thu May 07, 2009 11:00 am
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thank you so much for your quick reply. Your answer was helpful in helping me
find that I might be on the wrong track in finding the source of my problem.
the Item.GetInspector line is in my custom appointment form. When I allow
scripts to run on shared calendars and then I use my custom form to book a
resource, the resource that autoaccepts my invitiation shows a blank body of
the message. (This doesn't happen when 'allow scripts to run on shared
calendars' is disabled.)
When I remove that Item.GetInspector line, I'm finding that the body of my
appointment message is there fine.
That's why I thought perhaps the form class changes to something else in the
resource calendar response and GetInspector object would not exist...
I've been trying to figure this out on an off for weeks now - Do you have
any ideas?
thanks again for your last response!
"Sue Mosher [MVP]" wrote:
> VBScript does not support On Error GoTo. What you're doing with On Error
> Resume Next and Err <> 0 is a good approach.
>
> Item.GetInspector should never fail in a custom form. But if you're worried
> that it might, this is the way to handle it:
>
> On Error Resume Next
> Set insp = Item.GetInspector
> If insp Is Nothing Then
> ' there is no Inspector
> Else
> ' do something with insp
> End If
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54 >
>
> "Maui80" <Maui80.DeleteThis@discussions.microsoft.com> wrote in message
> news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
> >I would like to include some error handling in my VBScript on my custom
> >form.
> > I've tried the On Error GoTo statement, but I keep getting a Syntax Error.
> > Then I've tried
> > On Error Resume Next
> > ... code to check ...
> > If Err <> 0 Then
> > ... do stuff
> > End If
> > But my error catching code does not seem to execute (I'm pretty sure my
> > code
> > to check has a runtime error in it)
> >
> > Basically, I have the following procedure call in one of my events:
> > Item.GetInspector ...
> > I know that it fails sometimes. I'd like to catch the error if my
> > statement
> > fails and handle it.
> >
> > Any suggestions?
> > Thanks in advance!
>
>
>
(Msg. 4) Posted: Thu May 07, 2009 11:05 am
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Also, I marked your answer as 'Yes' it helped because it was the right
response to my question. However, I'm still hoping someone will help me with
my bigger problem. Should I repost as a new question? Thanks!
"Sue Mosher [MVP]" wrote:
> VBScript does not support On Error GoTo. What you're doing with On Error
> Resume Next and Err <> 0 is a good approach.
>
> Item.GetInspector should never fail in a custom form. But if you're worried
> that it might, this is the way to handle it:
>
> On Error Resume Next
> Set insp = Item.GetInspector
> If insp Is Nothing Then
> ' there is no Inspector
> Else
> ' do something with insp
> End If
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54 >
>
> "Maui80" <Maui80.RemoveThis@discussions.microsoft.com> wrote in message
> news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
> >I would like to include some error handling in my VBScript on my custom
> >form.
> > I've tried the On Error GoTo statement, but I keep getting a Syntax Error.
> > Then I've tried
> > On Error Resume Next
> > ... code to check ...
> > If Err <> 0 Then
> > ... do stuff
> > End If
> > But my error catching code does not seem to execute (I'm pretty sure my
> > code
> > to check has a runtime error in it)
> >
> > Basically, I have the following procedure call in one of my events:
> > Item.GetInspector ...
> > I know that it fails sometimes. I'd like to catch the error if my
> > statement
> > fails and handle it.
> >
> > Any suggestions?
> > Thanks in advance!
>
>
>
(Msg. 5) Posted: Thu May 07, 2009 11:11 am
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Oh and I forgot to add, my Item.GetInspector is in the event
Sub Item_CustomPropertyChange(ByVal Name)
"Maui80" wrote:
> Thank you so much for your quick reply. Your answer was helpful in helping me
> find that I might be on the wrong track in finding the source of my problem.
>
> the Item.GetInspector line is in my custom appointment form. When I allow
> scripts to run on shared calendars and then I use my custom form to book a
> resource, the resource that autoaccepts my invitiation shows a blank body of
> the message. (This doesn't happen when 'allow scripts to run on shared
> calendars' is disabled.)
>
> When I remove that Item.GetInspector line, I'm finding that the body of my
> appointment message is there fine.
>
> That's why I thought perhaps the form class changes to something else in the
> resource calendar response and GetInspector object would not exist...
>
> I've been trying to figure this out on an off for weeks now - Do you have
> any ideas?
>
> thanks again for your last response!
>
> "Sue Mosher [MVP]" wrote:
>
> > VBScript does not support On Error GoTo. What you're doing with On Error
> > Resume Next and Err <> 0 is a good approach.
> >
> > Item.GetInspector should never fail in a custom form. But if you're worried
> > that it might, this is the way to handle it:
> >
> > On Error Resume Next
> > Set insp = Item.GetInspector
> > If insp Is Nothing Then
> > ' there is no Inspector
> > Else
> > ' do something with insp
> > End If
> >
> > --
> > Sue Mosher, Outlook MVP
> > Author of Microsoft Outlook 2007 Programming:
> > Jumpstart for Power Users and Administrators
> > http://www.outlookcode.com/article.aspx?id=54 > >
> >
> > "Maui80" <Maui80 RemoveThis @discussions.microsoft.com> wrote in message
> > news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
> > >I would like to include some error handling in my VBScript on my custom
> > >form.
> > > I've tried the On Error GoTo statement, but I keep getting a Syntax Error.
> > > Then I've tried
> > > On Error Resume Next
> > > ... code to check ...
> > > If Err <> 0 Then
> > > ... do stuff
> > > End If
> > > But my error catching code does not seem to execute (I'm pretty sure my
> > > code
> > > to check has a runtime error in it)
> > >
> > > Basically, I have the following procedure call in one of my events:
> > > Item.GetInspector ...
> > > I know that it fails sometimes. I'd like to catch the error if my
> > > statement
> > > fails and handle it.
> > >
> > > Any suggestions?
> > > Thanks in advance!
> >
> >
> >
(Msg. 6) Posted: Thu May 07, 2009 2:28 pm
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
What are you seeking to do with the Inspector? What exactly do you mean by
"shows a blank body"? In code? In the UI?
"Maui80" <Maui80.TakeThisOut@discussions.microsoft.com> wrote in message
news:D13C5351-8319-4EB2-B0C1-7A1E49555827@microsoft.com...
> Thank you so much for your quick reply. Your answer was helpful in helping
> me
> find that I might be on the wrong track in finding the source of my
> problem.
>
> the Item.GetInspector line is in my custom appointment form. When I allow
> scripts to run on shared calendars and then I use my custom form to book a
> resource, the resource that autoaccepts my invitiation shows a blank body
> of
> the message. (This doesn't happen when 'allow scripts to run on shared
> calendars' is disabled.)
>
> When I remove that Item.GetInspector line, I'm finding that the body of my
> appointment message is there fine.
>
> That's why I thought perhaps the form class changes to something else in
> the
> resource calendar response and GetInspector object would not exist...
>
> I've been trying to figure this out on an off for weeks now - Do you have
> any ideas?
>
> thanks again for your last response!
>
> "Sue Mosher [MVP]" wrote:
>
>> VBScript does not support On Error GoTo. What you're doing with On Error
>> Resume Next and Err <> 0 is a good approach.
>>
>> Item.GetInspector should never fail in a custom form. But if you're
>> worried
>> that it might, this is the way to handle it:
>>
>> On Error Resume Next
>> Set insp = Item.GetInspector
>> If insp Is Nothing Then
>> ' there is no Inspector
>> Else
>> ' do something with insp
>> End If
>>
>> "Maui80" <Maui80.TakeThisOut@discussions.microsoft.com> wrote in message
>> news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
>> >I would like to include some error handling in my VBScript on my custom
>> >form.
>> > I've tried the On Error GoTo statement, but I keep getting a Syntax
>> > Error.
>> > Then I've tried
>> > On Error Resume Next
>> > ... code to check ...
>> > If Err <> 0 Then
>> > ... do stuff
>> > End If
>> > But my error catching code does not seem to execute (I'm pretty sure my
>> > code
>> > to check has a runtime error in it)
>> >
>> > Basically, I have the following procedure call in one of my events:
>> > Item.GetInspector ...
>> > I know that it fails sometimes. I'd like to catch the error if my
>> > statement
>> > fails and handle it.
>> >
>> > Any suggestions?
>> > Thanks in advance!
>>
>>
>>
(Msg. 7) Posted: Thu May 07, 2009 2:28 pm
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I have a custom tab on my appointment form. In it, I have a check box that
when the user checks or unchecks, it shows/hides a frame.
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "IsTrue"
Set oPage = Item.GetInspector.ModifiedFormPages
Set oCntrl = oPage("My Tab Name").Controls("My Control")
oCntrl.Visible = Item.UserProperties.Find("IsTrue").Value
Case "Etc"
....
End Select
End Sub
And when I mean 'blank body', I'm referring to the UI. In other words, the
message of the body is no longer there. I see the message body fine in my
calendar, but when I look at the calendar event in the resource calendar,
there is no message body.
In another post I made, the MVP suggested that when a user reply's, another
message class is used - IPM.Schedule.Meeting.Resp, and I would have to run
code to capture that item. So I tried checking if the
> What are you seeking to do with the Inspector? What exactly do you mean by
> "shows a blank body"? In code? In the UI?
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54 >
>
> "Maui80" <Maui80 DeleteThis @discussions.microsoft.com> wrote in message
> news:D13C5351-8319-4EB2-B0C1-7A1E49555827@microsoft.com...
> > Thank you so much for your quick reply. Your answer was helpful in helping
> > me
> > find that I might be on the wrong track in finding the source of my
> > problem.
> >
> > the Item.GetInspector line is in my custom appointment form. When I allow
> > scripts to run on shared calendars and then I use my custom form to book a
> > resource, the resource that autoaccepts my invitiation shows a blank body
> > of
> > the message. (This doesn't happen when 'allow scripts to run on shared
> > calendars' is disabled.)
> >
> > When I remove that Item.GetInspector line, I'm finding that the body of my
> > appointment message is there fine.
> >
> > That's why I thought perhaps the form class changes to something else in
> > the
> > resource calendar response and GetInspector object would not exist...
> >
> > I've been trying to figure this out on an off for weeks now - Do you have
> > any ideas?
> >
> > thanks again for your last response!
> >
> > "Sue Mosher [MVP]" wrote:
> >
> >> VBScript does not support On Error GoTo. What you're doing with On Error
> >> Resume Next and Err <> 0 is a good approach.
> >>
> >> Item.GetInspector should never fail in a custom form. But if you're
> >> worried
> >> that it might, this is the way to handle it:
> >>
> >> On Error Resume Next
> >> Set insp = Item.GetInspector
> >> If insp Is Nothing Then
> >> ' there is no Inspector
> >> Else
> >> ' do something with insp
> >> End If
> >>
> >> "Maui80" <Maui80 DeleteThis @discussions.microsoft.com> wrote in message
> >> news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
> >> >I would like to include some error handling in my VBScript on my custom
> >> >form.
> >> > I've tried the On Error GoTo statement, but I keep getting a Syntax
> >> > Error.
> >> > Then I've tried
> >> > On Error Resume Next
> >> > ... code to check ...
> >> > If Err <> 0 Then
> >> > ... do stuff
> >> > End If
> >> > But my error catching code does not seem to execute (I'm pretty sure my
> >> > code
> >> > to check has a runtime error in it)
> >> >
> >> > Basically, I have the following procedure call in one of my events:
> >> > Item.GetInspector ...
> >> > I know that it fails sometimes. I'd like to catch the error if my
> >> > statement
> >> > fails and handle it.
> >> >
> >> > Any suggestions?
> >> > Thanks in advance!
> >>
> >>
> >>
>
>
>
(Msg. 8) Posted: Thu May 07, 2009 3:23 pm
Post subject: Re: Outlook 2003 Custom Form Error Handling [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I'm still not clear on what you're doing. Is the user working with a check
box on an appointment in the Calendar folder or on a meeting request in the
Inbox?
I can't think of any reason why GetInspector would affect the item body. Is
there any code behind the form that touches the Body property?
Also, you said you have a resource calendar that autoaccepts invitations. If
this an autoaccept script, have you looked at its code? If it's Exchange
2007, is the resource calendar configured not to store appointment details?
(That's an option in 2007.)
"Maui80" <Maui80.DeleteThis@discussions.microsoft.com> wrote in message
news:0A6194FF-01B4-4CD6-9799-71FE7EE564C1@microsoft.com...
>I have a custom tab on my appointment form. In it, I have a check box that
> when the user checks or unchecks, it shows/hides a frame.
>
> Sub Item_CustomPropertyChange(ByVal Name)
> Select Case Name
> Case "IsTrue"
> Set oPage = Item.GetInspector.ModifiedFormPages
> Set oCntrl = oPage("My Tab Name").Controls("My Control")
> oCntrl.Visible = Item.UserProperties.Find("IsTrue").Value
> Case "Etc"
> ...
> End Select
> End Sub
>
> And when I mean 'blank body', I'm referring to the UI. In other words, the
> message of the body is no longer there. I see the message body fine in my
> calendar, but when I look at the calendar event in the resource calendar,
> there is no message body.
>
> In another post I made, the MVP suggested that when a user reply's,
> another
> message class is used - IPM.Schedule.Meeting.Resp, and I would have to
> run
> code to capture that item. So I tried checking if the
>
> Item.MessageClass <> "IPM.Appointment.MyAppointment"
>
> but that didn't help either...
>
>
> "Sue Mosher [MVP]" wrote:
>
>> What are you seeking to do with the Inspector? What exactly do you mean
>> by
>> "shows a blank body"? In code? In the UI?
>>
>>
>> "Maui80" <Maui80.DeleteThis@discussions.microsoft.com> wrote in message
>> news:D13C5351-8319-4EB2-B0C1-7A1E49555827@microsoft.com...
>> > Thank you so much for your quick reply. Your answer was helpful in
>> > helping
>> > me
>> > find that I might be on the wrong track in finding the source of my
>> > problem.
>> >
>> > the Item.GetInspector line is in my custom appointment form. When I
>> > allow
>> > scripts to run on shared calendars and then I use my custom form to
>> > book a
>> > resource, the resource that autoaccepts my invitiation shows a blank
>> > body
>> > of
>> > the message. (This doesn't happen when 'allow scripts to run on shared
>> > calendars' is disabled.)
>> >
>> > When I remove that Item.GetInspector line, I'm finding that the body of
>> > my
>> > appointment message is there fine.
>> >
>> > That's why I thought perhaps the form class changes to something else
>> > in
>> > the
>> > resource calendar response and GetInspector object would not exist...
>> >
>> > I've been trying to figure this out on an off for weeks now - Do you
>> > have
>> > any ideas?
>> >
>> > thanks again for your last response!
>> >
>> > "Sue Mosher [MVP]" wrote:
>> >
>> >> VBScript does not support On Error GoTo. What you're doing with On
>> >> Error
>> >> Resume Next and Err <> 0 is a good approach.
>> >>
>> >> Item.GetInspector should never fail in a custom form. But if you're
>> >> worried
>> >> that it might, this is the way to handle it:
>> >>
>> >> On Error Resume Next
>> >> Set insp = Item.GetInspector
>> >> If insp Is Nothing Then
>> >> ' there is no Inspector
>> >> Else
>> >> ' do something with insp
>> >> End If
>> >>
>> >> "Maui80" <Maui80.DeleteThis@discussions.microsoft.com> wrote in message
>> >> news:F846532B-BD9C-4169-9EC3-68B7A349C41C@microsoft.com...
>> >> >I would like to include some error handling in my VBScript on my
>> >> >custom
>> >> >form.
>> >> > I've tried the On Error GoTo statement, but I keep getting a Syntax
>> >> > Error.
>> >> > Then I've tried
>> >> > On Error Resume Next
>> >> > ... code to check ...
>> >> > If Err <> 0 Then
>> >> > ... do stuff
>> >> > End If
>> >> > But my error catching code does not seem to execute (I'm pretty sure
>> >> > my
>> >> > code
>> >> > to check has a runtime error in it)
>> >> >
>> >> > Basically, I have the following procedure call in one of my events:
>> >> > Item.GetInspector ...
>> >> > I know that it fails sometimes. I'd like to catch the error if my
>> >> > statement
>> >> > fails and handle it.
All times are: Eastern Time (US & Canada) (change) Goto page 1, 2
Page 1 of 2
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum