void AddContent(ref Word.Appliction app)
{
app.Selection.Start=0;
app.Selection.End=0;//將光標移動到文檔開始位置
object beginLevel=2;//目錄開始深度
object endLevel=2;//目錄結束深度
object rightAlignPageNumber=true;// 指定頁碼右對其
app.ActiveDocument.TablesOfContents.Add(app.Selection.Range,ref miss,rightAlignPageNumber,ref miss,
ref miss,ref miss,ref miss,ref miss);//寫入目錄
}