I am struggling to find an answer to the following problem. Any and all help would be appreciated.
I am using the following code to try and copy an outlook.pst file whil
PST provider locks PST files until the parent process terminates. Even if you close the PST file from Outlook, it will be kept open for 30 minutes for the performance reasons.
Do you programmatically open the PST file in Outlook?
Try the fmShareDenyNone flag when creating the TFileStream object:
stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone);
try
slFile.LoadFromStream(stream);
finally
stream.Free;
end;
Function to read the date from a file:
function GetFileDate(TheFileName: string): string;
var
FHandle: integer;
begin
FHandle := FileOpen(TheFileName, fmShareDenyNone);
try
Result := DateTimeToStr(FileDateToDateTime(FileGetDate(FHandle)));
finally
FileClose(FHandle);
end;
end;