Skip to main content
thetartankilt
Participant
July 16, 2014
Question

How do you modify content of a table, but retain the table's UserString?

  • July 16, 2014
  • 1 reply
  • 362 views

I have a document containing structured table elements.  The tables contain user string information [used by the FDK for tracking purposes], but when I apply a simple script to modify the table shading, I then find the UserString no longer exists on the table.  [I checked this by comparing the MIF statements].

My outline script is:

doc = app.ActiveDoc

tbl = doc.FirstTblInDoc

tblfmt = doc.GetNamedTblFmt ("RouteTable")

prop = tblfmt.GetProps()

tbl.FirstRowInTbl ; cell = row1.FirstCellInRow ; cell.CellUseOverrideShading = true ; cell.CellOverrideShading = null ; cell.CellUseOverrideFill = true ; cell.CellOverrideFill = 3 ; // change the table

tbl.SetProps (prop) // apply the changes


According to the FrameMaker scripting guide, only Element and CombinedFontDefn objects can hold user strings.

How can I modify the table [with table tag "RouteTable"] while retaining the Table's UserString?

This topic has been closed for replies.

1 reply

Legend
July 16, 2014

kilt,

This could be a tough question. UserString support for various objects has always been a bit uncertain to me. As you mention, FDK and ES docs only list the property for a couple of object types, but it seems to work in many places when used with the FDK.

ES seems different and perhaps it's a bug.  It does seem certain that ES does not support the property on a table object, but I don't know if that is by design. The documentation suggests that it is. If so, it would seem that you got lucky with the FDK but that luck ran out with ES. 

You said these are structured documents. Any particular reason that you can't use the element object instead? The UserString property seems to work reliably with those.

Russ

thetartankilt
Participant
July 16, 2014

Hello Russ,

Thank you for the response.  After reviewing my code, it appears that I was using GetProps() from the table format, whereas I should have referenced the GetProps() from the tbl.

Legend
July 16, 2014

I noticed that, but thought maybe it was on purpose. Either way, I don't think it is related to the UserString problem.