Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Variant word = CreateOleObject("Word.Application");
- word.OlePropertySet("Visible", "true");
- long row = CSpinEdit1->Value;
- long column = CSpinEdit2->Value;
- Variant docs = word.OlePropertyGet("Documents");
- Variant doc = docs.OleFunction("Open",fileName);
- Variant tables = doc.OlePropertyGet("Tables");
- int tablesCount = tables.OlePropertyGet("Count");
- for (int i = 1; i <= tablesCount; ++i) {
- Variant table = tables.OleFunction("Item", i);
- if (row <= (long)table.OlePropertyGet("Rows").OlePropertyGet("Count") &&
- column < (long)table.OlePropertyGet("Columns").OlePropertyGet("Count")) {
- Variant cell = table.OleFunction("Cell", row, column);
- cell.OleFunction("Merge", table.OleFunction("Cell", row, column + 1));
- }
- }
- doc.OleFunction("Save");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement