Home Forums DITA and XMetaL Discussion Multiple Entry Tags Add Text Reply To: Multiple Entry Tags Add Text

Derek Read

Reply to: Multiple Entry Tags Add Text

Because users interact with tables in a unique way when compared to standard elements in a document (what the user is seeing doesn't line up 1:1 with the XML so things get complicated) you need to use special (new and as yet undocumented) APIs to get a user's selection when it might consist of selected cells in a table.

Here's something that does what I think your example code is trying to do.
You can paste these into a document to see them run:

[code=VBScript]'XMetaL Script Language VBScript:
If Selection.IsMultiCellSelection Then
   Set c = Selection.Cells
For j = 0 to c.length
Application.Alert(“content: ” & Selection.Text)
End If[/code]

[code=JScript]//XMetaL Script Language JScript:
if(Selection.IsMultiCellSelection) {
   var c = Selection.Cells;
for(j=0; j Selection.SelectNodeContents(c(j));
Application.Alert(“content: ” + Selection.Text);