0 Replies Latest reply on Mar 28, 2013 4:24 AM by AdobeInDesignScriptKiddie

    Exception in rectangle.AssociatedXMLElement


      In the InDesign-Document I assigned manually some XMLTags to some rectangles.

      However when I use programmatically AssociatedXMLElement in order to read the XMLTags, I get an exception. Why?

      Is there an easier way to get the XMLTag of rectangles?




      foreach (InDesign.Rectangle rectangle in page.Rectangles)


      XMLItem xmlElement = (XMLItem)rectangle.AssociatedXMLElement; // Exception. Why?                          





      "Return argument has an invalid type"



      at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType)

      at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue)

      at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

      at Rectangle.get_AssociatedXMLElement()