2013-04-12 4 views
3

DocX library을 다운로드하여 사용하기 시작했습니다. 메모리에로드되는 template.docx이라는 문서가 있습니다. 그 서류에 id = 241 인 테이블이 있습니다. ID로 테이블을 가져 와서 행을 추가하고 싶습니다. 어떻게해야합니까? 여기 내 코드는 다음과 같습니다.DocX 라이브러리를 사용하여 DOCX 파일에서 테이블 찾기

using (DocX document = DocX.Load("template.docx")) 
{ 
    int tableId = 241, i = 0; 
    Table t = //here I need to find the table 

    foreach(DataGridViewRow row in produseFacturate.Rows) 
    { 
     i++; 

     //here I want to add rows to the table 
    } 
} 

답변

1

해결책을 직접 찾았습니다.

Table t = document.Tables[3]; // I found out that the table index is actually 3; 
: 이후

, document.Tables는 목록, 나는 다음과 같이 호출 할 수있다

관련 문제