Chào anh chị:
Từ file excel em copy table(j) sang word và căn chỉnh cho khớp:
Em căn chỉnh autofit contents thì được: wdDoc.Content.Tables(j).Columns.AutoFit
Nhưng căn chỉnh Table fit windowns thì không được ạ: wdDoc.Table(j).AutoFitBehavior (wdAutoFitWindow)
Tức là table vẫn không vừa khít với trang word, như hình em đính kèm ấy ạ. Anh chị giúp em với ạ./.
Từ file excel em copy table(j) sang word và căn chỉnh cho khớp:
Em căn chỉnh autofit contents thì được: wdDoc.Content.Tables(j).Columns.AutoFit
Nhưng căn chỉnh Table fit windowns thì không được ạ: wdDoc.Table(j).AutoFitBehavior (wdAutoFitWindow)
Tức là table vẫn không vừa khít với trang word, như hình em đính kèm ấy ạ. Anh chị giúp em với ạ./.
Mã:
Tables(j).Copy
wdRng.PasteExcelTable False, False, True
wdDoc.Content.Tables(j).Columns.AutoFit
wdDoc.Table(j).AutoFitBehavior (wdAutoFitWindow)
wdDoc.Content.InsertParagraphAfter