703
社区成员
发帖
与我相关
我的任务
分享
// 左侧的外边框设成 wdLineStyleDashLargeGap
vTable.OlePropertyGet("Borders").OleFunction("Item", -2).OlePropertySet("LineStyle", 4);
// 右侧的外边框设成 wdLineStyleDouble
vTable.OlePropertyGet("Borders").OleFunction("Item", -4).OlePropertySet("LineStyle", 7);
Variant vWordApp;
try
{
vWordApp = Variant::CreateObject("Word.Application");
}
catch(...)
{
MessageBox(Handle, "启动Word出错!",
Application->Title.c_str(), MB_OK | MB_ICONERROR);
return;
}
vWordApp.OlePropertySet("Visible", true);
Variant vDoc = vWordApp.OlePropertyGet("Documents").OleFunction("Add");
vWordApp.OlePropertyGet("ActiveDocument")
.OlePropertyGet("Tables").OleProcedure("Add",
vWordApp.OlePropertyGet("Selection").OlePropertyGet("Range"),
3, // NumRows
4, // NumColumns
1, // DefaultTableBehavior:=wdWord9TableBehavior
0); // AutoFitBehavior:=wdAutoFitFixed
Variant vTable = vWordApp.OlePropertyGet("ActiveDocument").
OleFunction("Range").OlePropertyGet("Tables").OleFunction("Item", 1);
vTable.OlePropertyGet("Borders").OlePropertySet("InsideLineStyle", 5); // wdLineStyleDashDot
vTable.OlePropertyGet("Borders").OlePropertySet("OutsideLineStyle", 20); // wdLineStyleDashDotStroked
...