| if (index < 0 || index > columnCount - 1) | if (index < 0 || index > columnCount - 1) | ||||
| throw new IndexOutOfRangeException(); | throw new IndexOutOfRangeException(); | ||||
| foreach (Row r in rows) | |||||
| foreach (Row r in Rows) | |||||
| r.Cells[index].Xml.Remove(); | r.Cells[index].Xml.Remove(); | ||||
| } | } | ||||
| rows = (from r in Xml.Elements(XName.Get("tr", DocX.w.NamespaceName)) | rows = (from r in Xml.Elements(XName.Get("tr", DocX.w.NamespaceName)) | ||||
| select new Row(this, Document, r)).ToList(); | select new Row(this, Document, r)).ToList(); | ||||
| rowCount = rows.Count; | |||||
| rowCount = Rows.Count; | |||||
| if (rows.Count > 0) | if (rows.Count > 0) | ||||
| if (rows[0].Cells.Count > 0) | if (rows[0].Cells.Count > 0) |
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <None Include="bin\Debug\docs\Input.docx" /> | <None Include="bin\Debug\docs\Input.docx" /> | ||||
| <None Include="Input.docx"> | |||||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |||||
| </None> | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
| const string str = "Hello World"; | const string str = "Hello World"; | ||||
| // Open the document Input.docx. | // Open the document Input.docx. | ||||
| using (DocX document = DocX.Load(@"docs\Input.docx")) | |||||
| using (DocX document = DocX.Load(@"Input.docx")) | |||||
| { | { | ||||
| // Make sure this document has at least one Image. | // Make sure this document has at least one Image. | ||||
| if (document.Images.Count() > 0) | if (document.Images.Count() > 0) |