AlexSPb19
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Таблица в Word задается через OLE при помощи следующего кода: { Variant Word, Document, Table, Cell; int RowCount, ColCount; Word = CreateOleObject("Word.Application.8"); Word.OlePropertySet("Visible", true); Word.OlePropertyGet("Documents").OleProcedure("Add"); Document = Word.OlePropertyGet("Documents").OleFunction("Item", 1); Table = Document.OlePropertyGet("Tables").OleFunction("Add", Document.OleFunction("Range", 0, 0), 5, 5); RowCount = Table.OlePropertyGet("Rows").OlePropertyGet("Count"); ColCount = Table.OlePropertyGet("Columns").OlePropertyGet("Count"); for (int i=1; i <=RowCount; i++) for(int j=1; j <=ColCount; j++) { Cell = Table.OleFunction("Cell", i, j); Cell.OlePropertyGet("Range").OleProcedure("InsertAfter", WideString(IntToStr(i)) + WideString("-") + WideString(IntToStr(j))); } Document.OleProcedure("SaveAs", ChangeFileExt(Application->ExeName, ".doc")); Word.OleProcedure("Quit"); } Как сделать так, чтобы ячейки таблицы создавались с рамкой? |