Word中Table边框设置有关问题
Word中Table边框设置问题?
在Excel可选择单元格的一个区域设置边框。
如下:sh.OlePropertyGet("Range","A1:C10").OlePropertyGet("Borders").OlePropertySet("linestyle",2);
//给指定区域的所有单元格加上边框,最后的数字:1=细实线框,2=短距虚线框,3=长距虚线框,4=点划线,5=双点划线,6=粗点划线
对于word中的Table,可否对于一个3行4列的表,整体设置其边框呀?
------解决方案--------------------
OLE专业户来也!!!
在Excel可选择单元格的一个区域设置边框。
如下:sh.OlePropertyGet("Range","A1:C10").OlePropertyGet("Borders").OlePropertySet("linestyle",2);
//给指定区域的所有单元格加上边框,最后的数字:1=细实线框,2=短距虚线框,3=长距虚线框,4=点划线,5=双点划线,6=粗点划线
对于word中的Table,可否对于一个3行4列的表,整体设置其边框呀?
------解决方案--------------------
OLE专业户来也!!!
- C/C++ code
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 ...