User Tools

Site Tools


Sidebar

filemanager:islinked

.islinked()

Method to check whether a topic from the TopicManager or a file from the FileManager is a linked file. This method is the equivalent of the function isLinkedFile()

A file is a linked file when the file is dynamically created and modified through a linked Word document or linked FrameMaker document. Linked files include topics, images and style sheets.

Usage

To check topics:

var tpmngr = currentProject.TopicManager;
for(var i = 1; i<=tpmngr.count; i++) {
  var topic = tpmngr.item(i);
  if(topic.isLinked()) {
    //Do something if this is a linked topic
  }
}

To check files from the FileManager:

var filemngr =currentProject.FileManager;
for(var i = 1; i<=filemngr.count; i++) {
  var file = filemngr.item(i);
  if(file.isLinked()) {
    //Do something if this is a linked file
  }
}

To check whether the file is created by a linked FrameMaker document:

if(file.isLinked("framemaker")) {
  //Do something for a file from a linked FrameMaker document.
}

To check whether the file is created by a linked Word document:

if(file.isLinked("word")) {
  //Do something for a file from a linked Word document.
}

Parameters

Parameter Data type Required Description
type string The type of linked document to check. Use word to check for Word documents only. Use framemaker to check for FrameMaker documents only. When omitted, the method checks whether the file is maintained by a linked document, regardless of the document type

Return Values

Value Meaning
null Cannot use the method .isLinked() on this object
true The file is a linked document of the type specified
false The file is not a linked document or is not a linked document of the type specified
filemanager/islinked.txt · Last modified: 2017/05/25 11:10 (external edit)