The Title states the error I am getting. I\'m trying to hide all the text in a word doc using OpenXml. Currently when I try and append the Paragraph propert
Normally this error can be fixed by Cloning whatever node is causing the exception and then inserting that cloned value. Something like this:
LeftBorder leftBorder = new LeftBorder() { Style = BorderStyleValues.Thin };
TopBorder topBorder = new TopBorder() { Style = BorderStyleValues.Thin };
RightBorder rightBorder = new RightBorder() { Style = BorderStyleValues.Thin };
BottomBorder bottomBorder = new BottomBorder() { Style = BorderStyleValues.Thin };
Color color = new Color() { Auto = true, Rgb = rgbHexValue == string.Empty ? new HexBinaryValue("00000000") : new HexBinaryValue(rgbHexValue) };
leftBorder.Color = color;
topBorder.Color = (Color)color.CloneNode(true);
rightBorder.Color = (Color)color.CloneNode(true);
bottomBorder.Color = (Color)color.CloneNode(true);
This will create one Color
instance and then use the same instance for all the borders by cloning the original instance then inserting it.