Copy link to clipboard
Copied
Hi Everyone,
I have looked from pillar to post on this one.
Basically when you open a Structured document in Unstructured FrameMaker a warning appears stating exactly what you are doing.
I am using FDK and have tried this in both Structured and Unstructured.
The test for structure in a document is to read the FP_HighestLevelElement property,
this returns true in Structured but false for a structured document within Unstructured FrameMaker.
Lost with this one, but if FrameMaker can detect a Structured document in Unstructured then I would much like to do also.
If any input at all could be provided it would be very much appreciated.
Yes, that is correct. F_ApiOpen() requires an input property list (F_PropValsT) and populates a second list after the operation that provides details about what went on. You need to configure the input property list to prohibit the opening of the file (FP_FileIsStructured = FV_DoCancel), then if the file fails to open, query the return property list for the reason. I think the flag you would be looking for is FV_CancelFileHasStructure, but I don't know for sure. In any case, Rick is right... you
...Copy link to clipboard
Copied
You will have to test for this when you open the document. Once the document is opened, the structure has already been stripped, and thus FP_HighestLevelElement will always return false. You should be able to cancel the open if your client attempts to open a structured document; then you can check the return parameters to see why the open was cancelled. I am not sure exactly how to do this with the FDK, but I know you can do it with FrameScript, so you should be able to do it with the FDK.
Rick Quatro
Copy link to clipboard
Copied
Yes, that is correct. F_ApiOpen() requires an input property list (F_PropValsT) and populates a second list after the operation that provides details about what went on. You need to configure the input property list to prohibit the opening of the file (FP_FileIsStructured = FV_DoCancel), then if the file fails to open, query the return property list for the reason. I think the flag you would be looking for is FV_CancelFileHasStructure, but I don't know for sure. In any case, Rick is right... you can't find out after you force it open, because the file is no longer structured at that point.
Russ
Copy link to clipboard
Copied
Thank you very much Rick and Russ.
This is great information and answers my question.
I can see the F_PropValsT *openParamsp property list being initialised and passed to F_ApiOpen().
Would much like to mark both as the correct answer, however, the deal breaker was the extra detail from Russ which I can relate to the code in progress.
Thanks again...
Copy link to clipboard
Copied
That's OK, give it to Russ :-). He just upgraded one of his great plugins (FrameSLT).