1,221
社区成员
发帖
与我相关
我的任务
分享
int nRowCount = 3;
int nColCount = 6;
vDoc.OlePropertyGet("Tables").OleProcedure("Add",
vSelect.OlePropertyGet("Range"),
nRowCount, // ÐÐÊý
nColCount, // ÁÐÊý
1, // DefaultTableBehavior:=wdWord9TableBehavior
0); // AutoFitBehavior:=wdAutoFitFixed
Variant vTable = vWordApp.OlePropertyGet("ActiveDocument").
OleFunction("Range").OlePropertyGet("Tables").OleFunction("Item", 1);
Variant vCell1 = vTable.OleFunction("Cell", 2, 3);
vCell1.OlePropertyGet("Shading").OlePropertySet("BackgroundPatternColor", 0xFF);
Variant vCell2 = vTable.OleFunction("Cell", 1, 5);
vCell2.OlePropertyGet("Shading").OlePropertySet("BackgroundPatternColor", 0xFF00);
Variant vCell3 = vTable.OleFunction("Cell", 3, 1);
vCell3.OlePropertyGet("Shading").OlePropertySet("BackgroundPatternColor", 0xFF0000);