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
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;