Corrupt form?

J

Jeff Mowatt

I suspect that the code in my custom form is corrupting the Appointment item
with which it's associated in some way.

By experimentation I discovered I can copy the vbscript code from my custom
form , create a new form using only the standard appointment template and
cause the same error that my custom form produces when I dismiss the
reminder.

In all other ways both forms work correctly, they can be opened and
modified, I can click snooze. Only on dismiss reminder so I get "Outlook.exe
has generated errors and will be terminated by Windows"

I'm rather lost as to where I might look now as what is happening appears to
be untraceable after PropertyChange() detects the ReminderSet change.

Jeff Mowatt
 
K

Ken Slovak - [MVP - Outlook]

Show your relevant form code.

Are these recurring items? If so you would need to get the specific item you
want using RecurrencePatter.GetOccurrence otherwise you'd be working with
the master item.
 
J

Jeff Mowatt

Ken,

My form code is about 600 lines, should I post just the PropertyChange() and
Write() elements or the whole thing?

No, definitely not recurring. I have disallowed this by forcing it back to
non-recurring when selected.

Regards,

Jeff Mowatt
 
A

Albacrest

Ken,

Here's the Read(), PropertyChange() and Write() portions plus a couple of
functions used .

Dim mp2
Dim strREQ
Dim strOPT
Dim strRES
dim acatitems
dim acatavail
dim acatlist
dim aportitems
dim aportavail
dim aportlist
dim atempport
dim atempcat
dim oldstart
dim oldend

Function Item_Read()
MSGBOX "START Item_Read()"
SET MP2 = NOTHING
strREQ = Item.RequiredAttendees
strOPT = Item.OptionalAttendees
strRES = Item.Resources
MSGBOX "END Item_Read()"
End Function

Sub Item_PropertyChange(ByVal Name)
ON ERROR RESUME NEXT
if name = "ReminderSet" then
msgbox "Changing Reminder Setting"
exit sub
end if
if meetingstatus = 5 then
msgbox "MeetingStatus = 5 detected - change ignored"
exit sub
end if

if name = "IsRecurring" then
msgbox "This form may not be used to create reccurring bookings"
item.clearrecurrencepattern
exit sub
end if
if mp2 is nothing then createmp2()
Set RoomPage = GetInspector.ModifiedFormPages("Rooms and Equipment")
Set RoomListBox = RoomPage.RoomListBox
Set EquipListBox = RoomPage.EquipListBox
set sitelistbox = Roompage.SiteListBox
set deptlistbox = roompage.deptlistbox
set bookref = roompage.bookref
if billinginformation <> "" THEN
select case name
case "IsRecurring"
msgbox "This form may not be used to create reccurring bookings"
item.clearrecurrencepattern
case "End"
DoChange(name)
case "Subject"
DoChange(name)
end select
end if
End Sub

Function Item_Write()
msgbox "Item_Write"
IF BILLINGINFORMATION <> "" THEN
For Each oRecip in Item.Recipients
If oRecip.Resolved = False Then recipresolved=false
Next
If strREQ <> Item.RequiredAttendees then
strREQ = Item.RequiredAttendees
'msgbox "strREQ Changed to: " & strREQ
DoChange("RequiredAttendees")
End If
If strOPT <> Item.OptionalAttendees then
strOPT = Item.OptionalAttendees
'msgbox "strOPT Changed to: " & strOPT
DoChange("OptionalAttendees")
End If
If strRES <> Item.Resources then
strRES = Item.Resources
'msgbox "strRES Changed to: " & strRES
dochange("Item.resources")
End If
if recipresolved=false then
' msgbox "unresolved recipients"
end if
END IF
End Function

sub CreateMP2()
'Load Automation Server to access SQLServer DB
on error resume next
set mp2 = createobject("MP2AutoServer.Application")
if mp2 is nothing then
msgbox "Unable to start Automation Server"
exit sub
end if
end sub

Sub DoChange(cstring)
'msgbox "Changing "+cstring
Set RoomPage = GetInspector.ModifiedFormPages("Rooms and Equipment")
cstart = Formatdatetime([start],2)
cend = formatdatetime([end],2)
cfrom = formatdatetime([start],4)
cto = formatdatetime([end],4)
if cfrom = cto then
msgbox "Invalid time range - Start and End cannot be the same"
item.start = oldstart
item.end = oldend
exit sub
end if
'npeople = recipients.count
npeople = mp2.getpeople(billinginformation)
CORG=SESSION.CURRENTUSER
'corg="Jeff Mowatt"
dim abook(20)
dim apeople(99)
for n=1 to recipients.count
set orecip = recipients.item(n)
apeople(n-1) = orecip.name
next
npeople=mp2.getpeople(billinginformation)
if npeople = 0 then npeople=recipients.count
asite=roompage.sitelistbox.list
adept=roompage.deptlistbox.list
arooms=roompage.roomlistbox.list
aequip=roompage.equiplistbox.list
if mp2 is nothing then exit sub
nresult=mp2.TXNAmend(corg,BILLINGINFORMATION,cstart,cend,cfrom,cto,npeople,a
people,abook,adept,asite,arooms,aequip)
end sub

----------------------------------------- end -------------------

The crash occurs immediately after the PropertyChange detects the
modification of ReminderSet and the Write() never happens.

I've done everything I can think of to make sure Outlook is not corrupt, ie
cleanreminders, repair office installation.

The Outlook Security Admin feature is installed on my test network but the
abort still happens at a customer site where it isn't installed.

Regards,

Jeff
 
K

Ken Slovak - [MVP - Outlook]

Hard to say from that what is causing the crash. What I'd do is comment out
the On Error Resume Next in PropertyChange and put a Stop statement in
there. That will cause an unhandled error in that procedure and you will be
offered a chance to debug the form. In the debugger set up a watch for Err
and step the code to see at least which line is causing the error. That
might be informative.

An alternative would be to comment out portions of that procedure's code and
see when it starts running without crashing.




Albacrest said:
Ken,

Here's the Read(), PropertyChange() and Write() portions plus a couple of
functions used .

Dim mp2
Dim strREQ
Dim strOPT
Dim strRES
dim acatitems
dim acatavail
dim acatlist
dim aportitems
dim aportavail
dim aportlist
dim atempport
dim atempcat
dim oldstart
dim oldend

Function Item_Read()
MSGBOX "START Item_Read()"
SET MP2 = NOTHING
strREQ = Item.RequiredAttendees
strOPT = Item.OptionalAttendees
strRES = Item.Resources
MSGBOX "END Item_Read()"
End Function

Sub Item_PropertyChange(ByVal Name)
ON ERROR RESUME NEXT
if name = "ReminderSet" then
msgbox "Changing Reminder Setting"
exit sub
end if
if meetingstatus = 5 then
msgbox "MeetingStatus = 5 detected - change ignored"
exit sub
end if

if name = "IsRecurring" then
msgbox "This form may not be used to create reccurring bookings"
item.clearrecurrencepattern
exit sub
end if
if mp2 is nothing then createmp2()
Set RoomPage = GetInspector.ModifiedFormPages("Rooms and Equipment")
Set RoomListBox = RoomPage.RoomListBox
Set EquipListBox = RoomPage.EquipListBox
set sitelistbox = Roompage.SiteListBox
set deptlistbox = roompage.deptlistbox
set bookref = roompage.bookref
if billinginformation <> "" THEN
select case name
case "IsRecurring"
msgbox "This form may not be used to create reccurring bookings"
item.clearrecurrencepattern
case "End"
DoChange(name)
case "Subject"
DoChange(name)
end select
end if
End Sub

Function Item_Write()
msgbox "Item_Write"
IF BILLINGINFORMATION <> "" THEN
For Each oRecip in Item.Recipients
If oRecip.Resolved = False Then recipresolved=false
Next
If strREQ <> Item.RequiredAttendees then
strREQ = Item.RequiredAttendees
'msgbox "strREQ Changed to: " & strREQ
DoChange("RequiredAttendees")
End If
If strOPT <> Item.OptionalAttendees then
strOPT = Item.OptionalAttendees
'msgbox "strOPT Changed to: " & strOPT
DoChange("OptionalAttendees")
End If
If strRES <> Item.Resources then
strRES = Item.Resources
'msgbox "strRES Changed to: " & strRES
dochange("Item.resources")
End If
if recipresolved=false then
' msgbox "unresolved recipients"
end if
END IF
End Function

sub CreateMP2()
'Load Automation Server to access SQLServer DB
on error resume next
set mp2 = createobject("MP2AutoServer.Application")
if mp2 is nothing then
msgbox "Unable to start Automation Server"
exit sub
end if
end sub

Sub DoChange(cstring)
'msgbox "Changing "+cstring
Set RoomPage = GetInspector.ModifiedFormPages("Rooms and Equipment")
cstart = Formatdatetime([start],2)
cend = formatdatetime([end],2)
cfrom = formatdatetime([start],4)
cto = formatdatetime([end],4)
if cfrom = cto then
msgbox "Invalid time range - Start and End cannot be the same"
item.start = oldstart
item.end = oldend
exit sub
end if
'npeople = recipients.count
npeople = mp2.getpeople(billinginformation)
CORG=SESSION.CURRENTUSER
'corg="Jeff Mowatt"
dim abook(20)
dim apeople(99)
for n=1 to recipients.count
set orecip = recipients.item(n)
apeople(n-1) = orecip.name
next
npeople=mp2.getpeople(billinginformation)
if npeople = 0 then npeople=recipients.count
asite=roompage.sitelistbox.list
adept=roompage.deptlistbox.list
arooms=roompage.roomlistbox.list
aequip=roompage.equiplistbox.list
if mp2 is nothing then exit sub
nresult=mp2.TXNAmend(corg,BILLINGINFORMATION,cstart,cend,cfrom,cto,npeople,a
people,abook,adept,asite,arooms,aequip)
end sub

----------------------------------------- end -------------------

The crash occurs immediately after the PropertyChange detects the
modification of ReminderSet and the Write() never happens.

I've done everything I can think of to make sure Outlook is not corrupt, ie
cleanreminders, repair office installation.

The Outlook Security Admin feature is installed on my test network but the
abort still happens at a customer site where it isn't installed.

Regards,

Jeff
 
A

Albacrest

Ken,

Using the debugger repeatedly over several days I can see that my form
script terminates normally every time.

I can click on other folders over the next few seconds but ultimately, up
pops the message "Outlook.exe has generated errors......"

Strangely It happens on my PC and the customer's but not on a pc that has
very few appointments in the calendar. I'll see what happens after some
housekeeping.

Jeff Mowatt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top