Home Forums General XMetaL Discussion XMetaL v4.6 – Reload image after editing Reply To: XMetaL v4.6 – Reload image after editing

dcramer

Reply to: XMetaL v4.6 – Reload image after editing

Yes, that's the way to do it (I believe the code snippet you found was Derek's answer to my question). Add a macro to reload the image. In my case the image element name is imagedata:

[code]  if (rng.ContainerName == “imagedata”) {
rng = ActiveDocument.Range;
rng.CollapsedContainerTags = true;
//Application.Alert(“collapsed”);
rng.CollapsedContainerTags = false;
    }
                                                                                                           
]]>
[/code]

And then add an item to the contextual menu:

[code]var curNode = rng.ContainerNode;
if (rng.ContainerName==”imagedata” && rng.ContainerNode.hasAttribute(“fileref”)) {   Application.AppendMacro(“&Reload Current Image”,”Reload Current Image”);
}
             
]]>
[/code]

Now the user can right-click on the image and select “Reload Current Image”.

Adjust for the names of the elements in your dtd.

David

Reply

Products
Downloads
Support