
05.05.2008, 00:49
|
|
Познающий
Регистрация: 02.03.2008
Сообщений: 33
Провел на форуме: 15157
Репутация:
0
|
|
Задание рамки у ячейки таблицы через OlePropertyGet в C++ Builder
Таблица в 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");
}
Как сделать так, чтобы ячейки таблицы создавались с рамкой?
Последний раз редактировалось De-visible; 05.05.2008 в 10:53..
Причина: Не забываем теги [code]!!!!!!!!
|
|
|