Quantcast
Channel: Adobe Community : Popular Discussions - Adobe FrameMaker
Viewing all articles
Browse latest Browse all 23442

InvalidObject understanding

$
0
0

Hi,

 

I encounter an issue with custom objects, I try to find Element with the function Find(). When I search Xref, row or known elements I get a valid Object. If a search for a custom element like here "RuleTemplate" I get an InvalidObject. Here is my code :

 

var searchPropValRuleTemplate = AllocatePropVals(1) // allocate array of 1 PropVal
searchPropValRuleTemplate[0].propIdent.num = Constants.FS_FindElementTag // element search mode
searchPropValRuleTemplate[0].propVal.valType = Constants.FT_Strings; // property of type Strings (array of string)
searchPropValRuleTemplate[0].propVal.ssval.length = Constants.FV_NumFindElementItems; // required
searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindElemTag] = "RuleTemplate"; // element to find
searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindAttrName]= ""; // required even if empty
searchPropValRuleTemplate[0].propVal.ssval[Constants.FV_FindAttrValue] = ""; // required even if empty

var startLoc = new TextLoc(currentDoc.FirstPgfInDoc, 0);
var trFoundInDoc = currentDoc.Find(startLoc, searchPropValRuleTemplate);
var currentSGMLTag = currentDoc.ElementSelection.beg.child.Object;
var firstUidSGMLTag = currentSGMLTag.Unique;

 

In this sample currentSGMLTag is an InvalidObject, if I change the propval FindElemTag to "XRef" by example I get my XRef valid Object.

Can anyone help me please ? I'm missing something.


Viewing all articles
Browse latest Browse all 23442

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>