Spiros Nikolopoulos
Guest
|
Hi,
I'm running an archiving procedure for a group of sel ected mails.
The selection list needs to be locked during the archiving procedure (which may take a lot time depending on the amount of selected mails).
Is it possible to lock the email selection list (or lock all the outlook application) and prevent user fr om using this list and modifying selection set?
Thanks |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hi Spiros,
How do you create such a list? Or maybe, you talk about items selected in the Outlook Explorer window? If the latter than I assume you cannot modify the selection until the archiving procedure is completed; this is because the procedure is run in the main thread.
Do I understand you right?
Andrei Smolin
Add-in Express Team Leader |
|
Spiros Nikolopoulos
Guest
|
I'm getting Selection list from "SelectedItems" of
class function OutlookUtils.GetExplorerSelectionItem(AExplorer: Explorer;var SelectedItems:SelectedItemsType): IDispatch;
var
sel: Selection;
i : Integer;
begin
result := nil;
sel := AExplorer.Selection;
try
if (sel.Count > 0) then begin
result := sel.Item(1);
setlength(SelectedItems,sel.Count);
for i := 0 to sel.Count-1 do
selectedItems[i] := sel.item(i+1);
end;
finally
sel := nil;
end;
end;
but during the archiving procedure which goes like :
for mlNo := 0 to length(SelectedItems) - 1 do //selected mails loop
Begin
...archive message MailItem(SelectedItems[mlNo]) ...
End;
I can click in outlook explorer window and modify selection. |
|
Spiros Nikolopoulos
Guest
|
OK I found it!
it was an Application.ProcessMessages inside the loop ... |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Oh, I see.
There was another way: you could store selected items to an array and process that array.
Andrei Smolin
Add-in Express Team Leader |
|