View Single Post
  #7  
Old May 28th 09, 07:31 PM posted to microsoft.public.outlook.program_addins
Ashish[_3_]
external usenet poster
 
Posts: 10
Default Outlook become non responsive if i write outlook item in bulk

Hi ken,

Write code should be fine, as even i create the outlook item manually, the
last modification time is not update. I mean use File - New-contact way to
creating contact.

While reading, namespace logoff/logon i tried so that session get refresh,
that was not the part of original code though.

Also if i close outlook and reopen i get the udpate last modification time
with the same read code.

It also look strange to me too and stranger is it happens only if outlook is
running for a long time, or as i mentioned a bulk write has been performed.


Best Regads
Ashish Rawat

"Ken Slovak - [MVP - Outlook]" wrote:

I don't understand.

That sample code you show does nothing that would modify the items,
therefore LastModificationTime is not going to change on any of the items.

Also why are you using NameSpace.Logoff? There's no reason for that at all.

This test VBA code shows what I mean. I selected a contact item and ran the
macro. The modified times shown are 3/23/2009 at 8:50 AM before the subject
is changed and 5/28/2009 at 1:39 PM afterwards.

Sub ModifyItem()
Dim oc As Outlook.ContactItem
Set oc = Application.ActiveExplorer.Selection(1)
Debug.Print oc.LastModificationTime
oc.Subject = oc.Subject & " Test"
oc.Save
Debug.Print oc.LastModificationTime
End Sub

This code was run in an Outlook setup that uses cached mode, therefore
demonstrating that cached mode has nothing to do with anything here.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Ashish" wrote in message
...
Hi Ken,

Good point, when i said outlook is non responsive, i mean this issue
itself,
there is no other syntoms to see outlook is not working properly. Rest
everything is outlook is going fine.

Ofcouse, i save outlook item and then check the last modification date.
I tried using tool like outlook spy tool, and something macro also. Also i
created a sample program as follows.


If InitOutlook() = True Then
objMapiFolder = objNamespace.PickFolder
objNamespace.Logoff()
'objNamespace.objNamespace.Logoff()
' objNamespace.Logon()
' objMapiFolder =
objNamespace.GetDefaultFolder(Outlook.OlDefaultFol ders.olFolderCalendar)

If Not objMapiFolder Is Nothing Then

oItems = objMapiFolder.Items
For Each ocontact In oItems
TextBox2.Text = TextBox2.Text +
Environment.NewLine + " Subject : " + ocontact.Subject
TextBox2.Text = TextBox2.Text + Environment.NewLine
+ " Last Modified time : " + ocontact.LastModificationTime

Next
End If

Still it gives the incorrect logs.


Best Regards
Ashish Rawat



Ads