V
vonclausowitz
I use this code to get a single or multiple selection of tasks and then
when hitting Delete move them to a folder named "Taken Oud". The
problem is that they all get renamed to the same name. What am I doing
wrong?
Dim garrTask()
Private Sub oExplorer_SelectionChange()
Dim i As Integer
If oExplorer.CurrentFolder.DefaultItemType = olTaskItem Then
For i = 1 To oExplorer.Selection.Count
ReDim garrTask(oExplorer.Selection.Count)
Set oTask = oExplorer.Selection(1) ' init first item to start
with
Set garrTask(i) = oExplorer.Selection(i) ' store in a global
array
MsgBox "" & garrTask(i)
Next
End If
End Sub
Private Sub oTasks_ItemRemove()
Dim myCopiedItem As Outlook.TaskItem
Dim olOldFolder As String
Dim i As Integer
olOldFolder = objDestinationFolder
For i = 1 To oExplorer.Selection.Count
ReDim garrTask(oExplorer.Selection.Count)
If oTask.Complete = True Then
MsgBox "Do you want to move " & oTask & " to " & olOldFolder &
" ?"
Set myCopiedItem = oTask.Copy
myCopiedItem.Move objDestinationFolder
End If
Next
End Sub
Regards
Marco
when hitting Delete move them to a folder named "Taken Oud". The
problem is that they all get renamed to the same name. What am I doing
wrong?
Dim garrTask()
Private Sub oExplorer_SelectionChange()
Dim i As Integer
If oExplorer.CurrentFolder.DefaultItemType = olTaskItem Then
For i = 1 To oExplorer.Selection.Count
ReDim garrTask(oExplorer.Selection.Count)
Set oTask = oExplorer.Selection(1) ' init first item to start
with
Set garrTask(i) = oExplorer.Selection(i) ' store in a global
array
MsgBox "" & garrTask(i)
Next
End If
End Sub
Private Sub oTasks_ItemRemove()
Dim myCopiedItem As Outlook.TaskItem
Dim olOldFolder As String
Dim i As Integer
olOldFolder = objDestinationFolder
For i = 1 To oExplorer.Selection.Count
ReDim garrTask(oExplorer.Selection.Count)
If oTask.Complete = True Then
MsgBox "Do you want to move " & oTask & " to " & olOldFolder &
" ?"
Set myCopiedItem = oTask.Copy
myCopiedItem.Move objDestinationFolder
End If
Next
End Sub
Regards
Marco