Skip to main content
Ch__Efstathios
Inspiring
April 12, 2016
Answered

Issue when opening documents.

  • April 12, 2016
  • 4 replies
  • 823 views

I am opening a document by using:

F_ObjHandleT docId = F_ApiOpen(componentName, &script, &returnp);

I also have set the following property to the script:

IntT i = F_ApiGetPropIndex(&script, FS_MakeVisible);

script.val.propVal.u.ival = False;

I have an FDK client which scans all opened books and for each one I get all components.

I open all documents from each book (and later on flows, etc) in order to extract all text items from the documents.

Since I have FS_MakeVisible to False the FDK client does it transparently and the user is not aware of it.

However, when some documents are already open then whenever I try to open these the program switches to these (however do not open it again) and the user looses his focus on the active document.

Is there any way to check if a document by its name is already open or set some setting to not switch to it after is opened?

This topic has been closed for replies.
Correct answer Mike-Hardy

The Session has a property for the FirstOpenDoc, and then each document has a property for the NextOpenDocInSession. Iterate through these to get all open documents, compare their Names to the document you are about to open.

4 replies

Mike-HardyCorrect answer
Participating Frequently
April 13, 2016

The Session has a property for the FirstOpenDoc, and then each document has a property for the NextOpenDocInSession. Iterate through these to get all open documents, compare their Names to the document you are about to open.

Ch__Efstathios
Inspiring
April 13, 2016

Hmmmmm..... :) So you say that I can firstly grap all the document names from the already opened documents (by iterating through FirstOpenDoc, NextOpenDocInSession, etc). And later on, when I will try to open all book components and open silently everything FS_MakeVisible False then I will skip the files that are already open? If this is the case I want to thank so much.

Participating Frequently
April 14, 2016

That should do what you want. yes.