0
我有一個Perl腳本,它使用Win32 :: OLE將一些文本行添加到Word文檔中的現有表中。
現在,我想要它也調整表格的列以匹配文本大小(就像雙擊兩列之間的垂直線) 我知道如何設置一個列到特定的寬度,但我可以似乎找不到用於調整列大小以匹配文本大小的API。Win32 OLE(perl) - 將表列寬度調整爲文本
誰能告訴我該找什麼?
僅供參考,這裏是我的腳本代碼片段:
my $tbl = $document->Tables(1);
my $row = $tbl->Rows->Add();
$row->Cells(1)->Range()->InsertAfter($timestamp);
$row->Cells(2)->Range()->InsertAfter($comment);
$row->Cells(3)->Range()->InsertAfter($username);
# TODO: resize columns to match the content
謝謝!添加了$ tbl-> Columns-> AutoFit();它工作得很好。 – yossiz74