Ken Slovak - said:
Can you provide me with the code you're using and a complete
description of your setup (version, patches, OS, email setups) here in
this thread? I'll test and see if I can verify this and submit it as a
bug to MS. They are working on Outlook 2003 SP1 at this time so maybe
if it's reproducible we can get it included in SP1 or at least get it
on the list for a possible hotfix.
Ken,
I mocked up a quick VB app to demonstrate the problem. Add the form
below to a VB EXE project.
When you run it, it will allow you to choose a source folder, and a
destination folder. When you click the Go button, it will move all
read messages from source to destination folder.
You can make a couple of test folders in your message store to test
with. Place some messages in the source, and run it to make sure it
works.
Now, to recreate the bug, just pick a message in the destination
folder and flag it for follow-up (I also added a reminder), then mark
it as completed. Reverse the source and dest folders on the program
and click Go again.
You should see the problem.
Regards,
-Frank
------------------------------------------------------------------------------
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2715
ClientLeft = 60
ClientTop = 345
ClientWidth = 5400
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 5400
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton btnGo
Caption = "Go"
Height = 375
Left = 2160
TabIndex = 7
Top = 2100
Width = 1035
End
Begin VB.TextBox txtDstFolder
Height = 315
Left = 1560
Locked = -1 'True
TabIndex = 4
Top = 1140
Width = 2535
End
Begin VB.CommandButton btnDstFolderBrowse
Caption = "Browse..."
Height = 375
Left = 4200
TabIndex = 3
Top = 1140
Width = 1035
End
Begin VB.CommandButton btnSrcFolderBrowse
Caption = "Browse..."
Height = 375
Left = 4200
TabIndex = 1
Top = 600
Width = 1035
End
Begin VB.TextBox txtSrcFolder
Height = 315
Left = 1560
Locked = -1 'True
TabIndex = 0
Top = 600
Width = 2535
End
Begin VB.Label Label3
Caption = "Move all Read mail messages from source
folder to destination folder"
Height = 315
Left = 180
TabIndex = 6
Top = 120
Width = 5055
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "Destination Folder:"
Height = 315
Left = 120
TabIndex = 5
Top = 1200
Width = 1395
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "Source Folder:"
Height = 315
Left = 120
TabIndex = 2
Top = 660
Width = 1395
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private objApp As Outlook.Application
Private objNS As Outlook.NameSpace
Private strSrcEntryId As String
Private strSrcStoreId As String
Private strDstEntryId As String
Private strDstStoreId As String
Private Sub btnGo_Click()
Dim item As Outlook.MailItem
Dim olSrcFolder As Outlook.MAPIFolder
Dim ReadItems As Items
On Error GoTo btnGo_Click_Error
Set olSrcFolder = objNS.GetFolderFromID(strSrcEntryId,
strSrcStoreId)
Set ReadItems = olSrcFolder.Items
Set item = ReadItems.Find("[Unread] = false")
Do While Not (item Is Nothing)
item.Move objNS.GetFolderFromID(strDstEntryId, strDstStoreId)
Set item = ReadItems.FindNext
Loop
Set item = Nothing
Set ReadItems = Nothing
Set olSrcFolder = Nothing
On Error GoTo 0
Exit Sub
btnGo_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in
procedure btnGo_Click of Form Form1"
End Sub
Private Sub btnSrcFolderBrowse_Click()
On Error Resume Next
Dim olFolder As Outlook.MAPIFolder
Set olFolder = objNS.PickFolder
If Not IsNull(olFolder) Then
txtSrcFolder.Text = olFolder.Name
strSrcEntryId = olFolder.EntryID
strSrcStoreId = olFolder.StoreID
End If
Set olFolder = Nothing
End Sub
Private Sub btnDstFolderBrowse_Click()
On Error Resume Next
Dim olFolder As Outlook.MAPIFolder
Set olFolder = objNS.PickFolder
If Not IsNull(olFolder) Then
txtDstFolder.Text = olFolder.Name
strDstEntryId = olFolder.EntryID
strDstStoreId = olFolder.StoreID
End If
Set olFolder = Nothing
End Sub
Private Sub Form_Load()
Set objApp = CreateObject("Outlook.application")
Set objNS = objApp.GetNamespace("MAPI")
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set objApp = Nothing
Set objNS = Nothing
End Sub