Asha,
I think I understand now. Somebody else renamed the file... you are just trying to catch the error in your code, right?
I tried to duplicate this scenario, but in my experiments, FrameMaker was smart enough to know what kind of file it was, regardless of the extension. So, here are just some ideas...
- If the file isn't actually "corrupt," you can use F_ApiGetObjectType() to find out whether it is a FO_Book, FO_Doc, or something else. If a document is corrupted, I don't know what that function might return.
- If the file is corrupt, I would think that you should be able to query some kind of property to find that out. For example, maybe you could count the number of paragraph formats in the file. My guess is that a corrupt document will have significantly fewer than you would expect to see, if any at all.
Russ