VSTO
            string mypath = "Document.docx";
            Word.Application wordApp = Application;
            wordApp.Documents.Open(mypath);

            foreach (Table table in this.Application.ActiveDocument.Tables)
            {
              table.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
              table.PreferredWidth = 100;
            }

Aspose.Words
            Document doc = new Document( "doc.docx");
            foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
            {
                table.PreferredWidth = PreferredWidth.FromPercent(100);
            }


Download

Last edited Jan 1, 2014 at 6:15 AM by asposemarketplace, version 2