Hi,
I have created a piece of code for changing an items form
type:
Public Sub ChangeMessageType()
Dim myolapp As Outlook.Application
Dim myinspector As Outlook.Inspector
Dim myItem As Outlook.AppointmentItem
Set myolapp = CreateObject("Outlook.Application")
Set myinspector = myolapp.ActiveInspector
Set myItem = myinspector.CurrentItem
myItem.MessageClass = "IPM.Appointment.Timereg"
myItem.Save
myItem.Close olSave
myItem.Display
'myolapp.GetNamespace("MAPI").GetItemFromID
(myItem.EntryID).Display
End Sub
I tricker it as a macro by pressing a button on the items
toolbar. The type (MessageClass) is changed just fine. I
then try to refresh the item to reflect the changes by
closing and reopening the item.
But when I do that programmatically like in the code
above the forms type is not refreshed. At least not the
displaying of the item - the properties actually tells
that the type has changed! The last outcommented line in
the code shows that I have tried to open the item
directly from the ID reference - but the result is the
same.
If I remove the line that reopens the item and then
reopens manually it works fine.
Any idea for how I can get the items form refreshed
automatically when clicking the button?
/Pau
Hollis D. Paul - 13 Sep 2004 21:54 GMT
> Any idea for how I can get the items form refreshed
> automatically when clicking the button?
You have to set MyItem to nothing, and then recreate it.
Hollis D. Paul [MVP - Outlook]
Hollis@outhousebythesound.com
Using Virtual Access 4.52 build 277 (32-bit), Windows 2000 build 2600
http://search.support.microsoft.com/kb/c.asp?FR=0&SD=TECH&LN=EN-US
Mukilteo, WA USA