Ивличев П.С. Практикум по информационным... Ч. 10
.pdf
|
|
|
21 |
|
|
|
|
– Paragraphs. |
|
||
|
1. |
|
. |
-149 |
.НoМm. |
|
|
|
|
|
|
|
-149 |
.НoМm |
|
|
|
|
, |
|
|
+. |
- |
|
|
|
|
( |
). |
|
, |
|
|
|
- |
|
+ |
. |
, |
|
|
|
|
|
|
|
|
|
. |
: |
|
|
|
|
|
|
|
||
1. |
|
( |
|
): |
|
|
– Times New Roman; |
|
|||
|
|
– 14 |
; |
|
|
|
|
( |
– |
; |
|
2. |
|
|
): |
|
|
|
– Arial; |
|
|
||
|
|
|
; |
|
|
|
|
|
– |
; |
|
|
|
|
– |
; |
|
|
|
|
– |
; |
|
3. |
|
|
( |
1): |
|
|
– 10 |
; |
|
|
|
|
|
|
– |
; |
|
4. |
|
( |
, |
|
): |
|
|
– |
; |
|
|
|
|
|
– |
; |
|
|
|
|
– 12 |
; |
|
|
|
|
|
– |
|
(Selection.Paragraphs.KeepWithNext = True); |
|
||||
5. |
|
: |
– 1,27 |
; |
|
|
|
|
|||
|
|
|
– |
; |
( ...): |
6. |
|
|
( |
, |
|
|
|
+ |
10 + |
- |
|
|
; |
|
|
|
|
7. |
( |
|
): |
|
|
|
|
– |
|
; |
|
|
|
– 12 . |
|
|
|
|
|
|
|
( |
- |
|
|
|
|
ActiveDocu- |
|
|
|
22 |
|
|
|
|
ment.Paragraphs), |
|
, |
|
|
|
|
( |
), |
|
|
|
|
|
|
- |
. |
|
|
|
|
|
|
- |
|
|
|
|
|
|
|
|
. |
" |
" |
, |
|
". ( |
- |
|
" |
|
|
- |
||||
|
|
12). |
|
|
|
|
|
. |
|
" |
" |
|
, |
|
- |
" |
|
|
". |
( |
|||
|
|
|
|
|
|
|
|
) |
|
|
. |
|
|
|
- |
, |
|
. |
|
|
|
|
- |
|
|
|
|
|
|
|
|
|
|
|
|
|
= |
|
|
|
|
. |
.; . |
|
|
||
|
|
|
( |
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For |
|
|
= а _ а |
_ а |
[Step |
а ] |
|
||||
|
|
|
|
|
а |
|
ы |
|
|
|
|
|
|
|
|
Next |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
" |
|
|
, |
- |
|
|
|
|
|
|
|
|
|
|
|
", |
- |
|
|
|
|
|
|
|
. |
|
|
|
|
|
- |
|
|
|
|
|
|
|
( |
). |
|
|
|
|
||
|
|
|
|
( |
|
) |
|
|
|
|
, |
- |
|
|
|
|
|
|
|
|
|
|
(« |
» |
« |
», « |
» |
« |
|
») |
|
|
|
|
|
|
|
|
|
. |
|
« |
|
– |
– |
» |
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
If |
|
Then |
|
|
|
|
|
лов |
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
Else |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
в |
1 |
|
|
|
|
в 2 |
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
End If |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
|
|
|
|
, |
|
2. |
|
|
|
|
|
|
2 – |
|
|
|
|
|
|
|
|
|
|
Visual Basic |
|
|
|
|
= |
|
|
= |
|
|
|
|
≠ |
|
|
<> |
|
|
|
|
< |
|
|
< |
|
|
|
|
> |
|
|
> |
|
|
|
|
|
|
|
AND |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NOT |
|
|
|
. |
|
|
|
|
- |
|
|
|
|
|
|
|
||
|
13. |
|
|
|
|
|
|
|
2. |
|
-149 |
.НoМm. |
VBA |
||
|
, |
|
|
, |
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
, |
|
|
|
. |
|
. |
|
|
|
- |
||
|
|
|
|
|
|||
|
, |
. |
|
|
|
||
|
|
|
. |
|
|
||
|
|
|
|
|
|
|
|
|
3. |
|
|
|
. |
|
|
|
. |
. |
|
|
. |
||
|
. |
|
|
|
|||
|
|
|
|
|
|
||
|
: |
– |
|
|
|
|
- |
|
|
|
|
|
|
||
|
|
|
. |
, |
- |
||
|
. |
|
|
|
|||
|
, |
|
|
|
|||
|
, |
|
|
. |
|
||
SuЛ |
0() |
|
|
|
|
|
|
|
‘ |
|
|
|
|
|
|
|
Selection.WholeStory |
|
|
|
|
|
|
|
Selection.Font.Name = "Times New Roman" |
|
|
|
|||
|
Selection.Font.Size = 14 |
|
|
|
|
|
|
|
Selection.Paragraphs.LineSpacing = LinesToPoints(1) |
|
|||||
|
Dim all_par As Integer, tek_par As Integer, i As Integer ‘ |
all_par - |
|||||
|
|
|
, tek_par |
|
|
|
24 |
|
|
all_par = ActiveDocument.Paragraphs.Count ‘ |
|
- |
tek_par = 1 ‘ |
|
|
Do While ActiveDocument.Paragraphs(tek_par).Range.Words(1) <> " |
" And |
|
ActiveDocument.Paragraphs(tek_par).Range.Words(1) <> " |
" ‘ |
|
ActiveDocument.Paragraphs(tek_par).Range. Select ‘ |
|
- |
With Selection. Paragraphs ‘ |
|
|
.LineSpacing = LinesToPoints(1.5) |
|
|
.Alignment = wdAlignParagraphCenter |
|
|
End With |
|
|
With Selection.Font ‘ |
|
|
.Name = "Arial" |
|
|
.AllCaps = True |
|
|
.Bold = True |
|
|
End With |
|
|
tek_par = tek_par + 1 ‘ |
|
|
Loop |
|
|
‘ |
|
|
Do While ActiveDocument.Paragraphs(tek_par).Range.Words(1) <> " |
" And |
|
ActiveDocument.Paragraphs(tek_par).Range.Words(1) <> " |
" |
|
... |
|
|
tek_par = tek_par + 1 |
|
|
Loop |
|
|
‘ |
|
|
For i = tek_par To all_par - 5 |
|
|
ActiveDocument.Paragraphs(i).Range.Select |
|
|
If ActiveDocument.Paragraphs(i).Range.Words(1) = " |
" Then |
|
‘ |
|
|
...
Else
‘
...
If ActiveDocument.Paragraphs(i).Range.Characters(1) = "(" Then
‘
...
End If
End If
Next i
‘
For i = all_par - 5 To all_par
...
25
Next i
End Sub
4.
|
|
VBA |
|
, |
|
|
Office |
. |
- |
||
. |
|
||||
|
VBA |
|
|
||
(UserForms). |
UserForm |
|
|
, |
|
, |
|
|
1. |
- |
|
. |
|
|
|
||
, |
, |
, |
. |
||
|
|||||
, |
|
|
|
- |
|
|
. |
|
|
- |
|
|
, |
|
|
- |
|
, |
|
, |
|
- |
|
. |
|
, |
, |
- |
|
, |
. |
||||
|
|
|
|||
|
– |
, |
|
- |
|
|
|
|
|
, |
, |
. |
14. |
VBA |
1. |
.docm. |
VBA |
|
. |
|
12. |
VBA |
. |
|
|
. |
View – Project Ex- |
|
plorer. |
. |
|
|
|
View – Code |
|
|
|
|
|
|
|
. |
|
- |
, |
, |
– |
- |
. |
View – Properties Window. |
|
|
|
|
||
|
|
. |
|
Alphabetic |
Categorized |
. |
|
: |
|
- |
|
|
|
26 |
|
|
, |
– |
- |
, |
|
. |
|
12 – |
|
VBA |
|
|
|
. |
.docm |
, |
- |
|
( |
14). |
|
, |
|
- |
|
|
. |
|
||
|
|
. |
|
|
|
|
|
|
|
|
|
|
15. |
|
|
|
- |
|
|
|
|
|
|
|
Project |
|
|
|
|
Insert – UserForm. |
|
|
, |
- |
|
|
13, |
. |
|
|
|
|
|
|
|
|
|
1. |
|
.docm |
|
. |
. |
|
, |
Name ( |
). |
|
- |
|
|
|
|
||
|
. |
|
|
|
- |
|
, |
|
|
|
|
|
|
27 |
|
. |
Caption |
( |
). |
|
2. |
, |
. |
|
|
. |
3. |
BackColor |
. |
|
. |
|
13 –
16.
1. |
|
|
|
Project ( |
), |
Microsoft Word Objects |
- |
|
ThisDocument – |
Document, |
. |
|
|
|
|
|
Open ( |
) – |
- |
|
. |
|
|
|
, |
.docm |
|
|
. |
, |
Private Sub |
Document_Open() |
Show |
||
UserForm1. |
|
|
|
2. |
|
UserForm1.Show. |
- |
|
.docm, |
- |
|
. |
|
. |
VBA. |
|
17. |
|
|
1. |
|
|
|
Project ( |
), |
Forms |
|
|
|
28 |
|
|
UserForm1– |
|
|
|
|
|
|
|
Toolbox. |
|
|
|
2. |
14. |
|
|
3. |
Label |
- |
|
, |
. |
- |
|
Caption, |
В |
- |
|
. |
Font |
- |
|
|
10 . |
В |
|
4. |
. |
|
|
|
?. |
|
|
5. |
В |
|
14 – |
|
|
|
|
TextBox |
- |
/ |
. |
|
- |
|
, |
|
Text1. |
Value. |
|
Text |
|
|
|
|
|
6. |
|
, |
. |
|
Text |
|
|
. |
, |
|
. |
7. |
ControlTipText, |
, |
|
, |
. . |
|
- |
. |
|
ComboBox
|
|
|
29 |
|
|
|
. |
|
|
|
|
|
|
. |
|
|
|
|
|
|
8. |
|
|
. |
, |
|
- |
, |
|
|
|
, |
|
|
|
|
Style 2-fmStyleDropDownList. |
||||
|
|
|
|
. |
|
|
|
|
|
|
|
OptionBut- |
|
ton. |
|
|
|
|
|
- |
. |
|
|
|
Caption, |
||
– Font. |
|
|
|
|
|
|
9. |
|
|
|
|
|
- |
. |
|
|
Д , |
– |
. |
- |
|
|
|
||||
|
|
|
|
10 |
. |
|
Value |
|
|
. |
True – |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Com- |
mandButton. |
|
|
|
|
|
- |
. |
|
|
|
Caption. |
|
- |
Click. |
, |
|
|
|
|
|
|
. |
|
|
|
||
|
|
|
|
|
|
|
10. |
|
|
В |
, |
|
- |
14. |
|
|
. |
|
|
|
|
|
|
|
|
|
|
11. |
TabIndex |
|
|
|
|
|
, |
|
|
|
|
|
|
. |
|
|
|
0, 1 2 |
- |
|
TextBox, ComboBox |
CommandButton |
|
. |
|
||
12. |
TabStop |
Tab. |
|
, |
|
|
|
|
|
|
|
|
|
False, |
|
|
, |
|
. |
- |
|
– |
True. |
TabStop |
False, |
||
13. |
|
|
|
|||
Default |
CommandButton |
|
|
|||
|
. |
|
|
|
|
- |
Enter, |
|
|
, |
|
|
. |
|
CommandButton1 |
|
|
True. |
|
|
|
30 |
|
|
|
|
|
|
|
|
|
|
14. |
|
|
Height |
Width |
, |
, |
, |
|
|
, |
|
|
- |
. |
|
|
|
|
|
|
15. |
|
|
|
, |
Private |
Sub |
Document_Open(). |
|
|
|
Run |
||
Sub |
|
. |
|
|
|
- |
. |
, |
|
|
|
. |
, |
VBA. |
Tab. |
|
. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18. |
|
|
|
|
- |
|
|
ComboBox. |
|
|
||
AddItem |
|
|
|
|||
|
|
И |
.AddItem " |
|
" |
|
|
|
|
Initialize, |
|
|
, |
Show). |
|
|
( |
, |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
1. |
UserForm. |
|
|
- |
||
|
|
Initial- |
||||
ize – |
|
|
Private Sub UserForm_Initialize(). |
|
||
, |
|
|
|
ComboBox1 |
- |
|
, |
|
|
. |
|
|
|
|
|
|
|
|
||
ComЛoBoб1.AННItОm " |
|
” |
|
|||
2. |
|
|
|
|
|
|
|
|
TextBox1.SetFocus |
, |
|
|
|
SetFocus |
|
TextBox1 |
|
|
||
|
|
|
. |
|
|
|
3. |
|
|
. |
|
|
- |
. |
|
|
|
|
|
- |
( |
|
|
|
|
|
- |
). |
|
|
. |
|
VBA. |
|
|
19. |
|
, |
|
VBA |
|
|
|
|
|
|
|
|
В |
|
. |
|
|
|
- |
|
|
|
|
|
Д , |
|
. |
, |
|
|
|
- |
|
|
|
|
|
|
. |
- |
, |
|
|
|
CommandButton1, |
- |
Click.