AnsweredAssumed Answered

Error: already exists.(stg_e_filealreadyexists) when using IMapDocument.Open method ?

Question asked by taibc on Dec 26, 2013
Latest reply on Dec 30, 2013 by taibc
Hi everyone,

I got the errror: already exists.(stg_e_filealreadyexists) when using the method IMapDocument.Open() as below codes:

if (File.Exists (strDirectory + "\\temp.mxd"))         File.Delete(strDirectory + "\\temp.mxd"); System.IO.FileStream oFileStream = new System.IO.FileStream(strDirectory + "\\temp.mxd", FileMode.Create); oFileStream.Write(MyImage, 0, MyImage.Length); IMapDocument mapDoc = new MapDocumentClass(); mapDoc.Open(strDirectory + "\\temp.mxd"); // Throw exception


Do you know why and how to fix this error ?

Thanks and regards,

Tai

Outcomes