1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
| void __fastcall TForm1::Button32Click(TObject *Sender)
{Variant vApp,vDocs,vBookmarks,vBookmark, vDoc, vSelection, vRange;
AnsiString nah;
nah=Form1->DBEdit1->Text.c_str();
vApp = CreateOleObject("Word.Application");
vApp.OlePropertySet("Visible", false);
vDocs = vApp.OlePropertyGet("Documents");
vDocs.OleFunction("Add", WideString(GetCurrentDir()+"\\Shablon2.dot")); //копирует исходный шаблон
vDoc=vDocs.OleFunction("Item",1);
vDoc.OleProcedure("Activate");
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x1"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit1->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x2"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit5->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x3"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit25->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x4"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit27->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x5"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit6->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x6"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit7->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x7"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit8->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x8"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit27->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x9"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit3->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x10"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit9->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x11"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit24->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x12"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit2->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x13"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit22->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x14"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit25->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x15"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit26->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x16"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit26->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x17"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit4->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x18"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit23->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x19"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit28->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x20"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBMemo1->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x21"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit10->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x22"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit11->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x23"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit12->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x24"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit13->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x25"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit14->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x26"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit15->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x27"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit16->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x28"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit17->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x29"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit18->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x30"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit19->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x31"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit20->Text.c_str()));
vBookmarks = vDoc.OlePropertyGet("Bookmarks");
vBookmark = vBookmarks.OleFunction("Item", WideString("x32"));
vBookmark.OleProcedure("Select");
vSelection = vApp.OlePropertyGet("Selection");
vSelection.OlePropertySet("Text", WideString(Form1->DBEdit21->Text.c_str()));
vRange = vDoc.OleFunction("Range", 0, 0);
vRange.OleProcedure(_T("Select"));
vApp.OlePropertySet("Visible",true);} |