private Xdr.TwoCellAnchor AddTwoCellAnchor(int startRow, int startColumn, int endRow, int endColumn, string imagerId) { Xdr.TwoCellAnchor twoCellAnchor1 = new Xdr.TwoCellAnchor() { EditAs = Xdr.EditAsValues.OneCell }; Xdr.FromMarker fromMarker1 = new Xdr.FromMarker(); Xdr.ColumnId columnId1 = new Xdr.ColumnId(); columnId1.Text = startColumn.ToString(); Xdr.ColumnOffset columnOffset1 = new Xdr.ColumnOffset(); columnOffset1.Text = "0"; Xdr.RowId rowId1 = new Xdr.RowId(); rowId1.Text = startRow.ToString(); Xdr.RowOffset rowOffset1 = new Xdr.RowOffset(); rowOffset1.Text = "0"; fromMarker1.Append(columnId1); fromMarker1.Append(columnOffset1); fromMarker1.Append(rowId1); fromMarker1.Append(rowOffset1); Xdr.ToMarker toMarker1 = new Xdr.ToMarker(); Xdr.ColumnId columnId2 = new Xdr.ColumnId(); columnId2.Text = endColumn.ToString(); Xdr.ColumnOffset columnOffset2 = new Xdr.ColumnOffset(); columnOffset2.Text = "0";// "152381"; Xdr.RowId rowId2 = new Xdr.RowId(); rowId2.Text = endRow.ToString(); Xdr.RowOffset rowOffset2 = new Xdr.RowOffset(); rowOffset2.Text = "0";//"152381"; toMarker1.Append(columnId2); toMarker1.Append(columnOffset2); toMarker1.Append(rowId2); toMarker1.Append(rowOffset2); Xdr.Picture picture1 = new Xdr.Picture(); Xdr.NonVisualPictureProperties nonVisualPictureProperties1 = new Xdr.NonVisualPictureProperties(); Xdr.NonVisualDrawingProperties nonVisualDrawingProperties1 = new Xdr.NonVisualDrawingProperties() { Id = (UInt32Value)2U, Name = "Picture 1" }; Xdr.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties1 = new Xdr.NonVisualPictureDrawingProperties(); A.PictureLocks pictureLocks1 = new A.PictureLocks() { NoChangeAspect = true }; nonVisualPictureDrawingProperties1.Append(pictureLocks1); nonVisualPictureProperties1.Append(nonVisualDrawingProperties1); nonVisualPictureProperties1.Append(nonVisualPictureDrawingProperties1); Xdr.BlipFill blipFill1 = new Xdr.BlipFill(); A.Blip blip1 = new A.Blip() { Embed = imagerId }; blip1.AddNamespaceDeclaration("r", "http://schemas.openxmlformats.org/officeDocument/2006/relationships"); A.BlipExtensionList blipExtensionList1 = new A.BlipExtensionList(); A.BlipExtension blipExtension1 = new A.BlipExtension() { Uri = "{28A0092B-C50C-407E-A947-70E740481C1C}" }; A14.UseLocalDpi useLocalDpi1 = new A14.UseLocalDpi() { Val = false }; useLocalDpi1.AddNamespaceDeclaration("a14", "http://schemas.microsoft.com/office/drawing/2010/main"); blipExtension1.Append(useLocalDpi1); blipExtensionList1.Append(blipExtension1); blip1.Append(blipExtensionList1); A.Stretch stretch1 = new A.Stretch(); A.FillRectangle fillRectangle1 = new A.FillRectangle(); stretch1.Append(fillRectangle1); blipFill1.Append(blip1); blipFill1.Append(stretch1); Xdr.ShapeProperties shapeProperties1 = new Xdr.ShapeProperties(); A.Transform2D transform2D1 = new A.Transform2D(); A.Offset offset1 = new A.Offset() { X = 0L, Y = 0L }; A.Extents extents1 = new A.Extents() { Cx = 152381L, Cy = 152381L }; transform2D1.Append(offset1); transform2D1.Append(extents1); A.PresetGeometry presetGeometry1 = new A.PresetGeometry() { Preset = A.ShapeTypeValues.Rectangle }; A.AdjustValueList adjustValueList1 = new A.AdjustValueList(); presetGeometry1.Append(adjustValueList1); shapeProperties1.Append(transform2D1); shapeProperties1.Append(presetGeometry1); picture1.Append(nonVisualPictureProperties1); picture1.Append(blipFill1); picture1.Append(shapeProperties1); Xdr.ClientData clientData1 = new Xdr.ClientData(); twoCellAnchor1.Append(fromMarker1); twoCellAnchor1.Append(toMarker1); twoCellAnchor1.Append(picture1); twoCellAnchor1.Append(clientData1); return twoCellAnchor1; }