Home Forums General XMetaL Discussion Xmetal Toolbar macro Reply To: Xmetal Toolbar macro

pooh2583

Reply to: Xmetal Toolbar macro

Hi,

I am developing a code for Mouse_over macro in which when my mouse is over the specific element it shold be seen as a hyperlink,i.e cursor is changed to hand cursor ad color of the text of the node should change.

my element stucture is
text-string
aaa
….
..
ajgh

my functionality is when my mouse is over the node named the color of the tesxt-string should change and cursor

bI am using following code from journalist.mcr
var curNode = Application.MouseOverNode;
 if (curNode) {
   var nodeName = curNode.NodeName;
   if (nodeName == “element”) {
     Application.SetCursor(sqCursorHand);
     var rng = ActiveDocument.Range;
     rng.SelectNodeContents(curNode);
     rng.ContainerStyle = “color:red”;
     rng = null;
     return;
   }

but the above code changes the color of the entire content of the including subelement,I just want the color of the(PCDATA) ie. text-string to be changed(marked as bold)

what is the  way to select only the PCDATA string i.e text-string “text-string”
and change the color of that TEXT-Node only

Please reply
Regards

Reply

Products
Downloads
Support