Outlook not refreshing using the OOM

  • Thread starter Thread starter Mike R
  • Start date Start date
M

Mike R

Hi,

My program reads Sues calendar, displays the appointment - all ok,

Sue modified her appointment, saves it. My program reads her calendar and
doesnt pick up the changes she has just made. It appears to work fine in
VB6, however, I need to use VB.NET.

Anybody have any thoughts - or has got this working? I read that maybe you
could use CDO to do the same thing, if so, could someone post a snippet of
code that points me in the correct direction.

Kind Regards


Mike
---------------

My code :

Private Sub Command1_Click()

Dim NS As Outlook.NameSpace
Dim MyOLApp As Outlook.Application

Dim MyRecipient As Outlook.Recipient
Dim cf As mapiFolder
Dim MyItems As Outlook.Items
Dim MyCalItem As Outlook.AppointmentItem

Set MyOLApp = New Outlook.Application
Set NS = MyOLApp.GetNamespace("MAPI")

NS.Logon "E4SE", , False, True

Set MyRecipient = NS.CreateRecipient("Sue")
Set cf = NS.GetSharedDefaultFolder(MyRecipient, olFolderCalendar)

Set MyItems = cf.Items
Set MyCalItem = MyItems.GetFirst

MyCalItem.display

NS.Logoff
Set NS = Nothing

End Sub
 
Have you rerun the parts of your code that is retrieving the modified appointment? If the objects have not been reinitialized, it may not be picking up Sue's changes. Rerun the code after the changes have been made and see.

If you want to port this to VB.NET, see http://www.outlookcode.com/d/index.htm#dotnet for more info.

You could use CDO too, however there's nothing you can do there that you can't do with Outlook VBA for your solution. Note also that CDO is unsupported in .NET (but some people use it anyway).
 
Back
Top