VBA Word . Range Selection, , Word VBA. , , . , , .
Word Range, . , , , . . . , , :
ActiveDocument.Paragraphs(1).Range.Text = Oxo-xo!!
. , Selection, , Add Text Selection:
If Documents.Count = 0 Then Documents.Add
Selection.Text = " Word VBA, + TextBox1.Text +, !
Word : Word VBA, , !.
Private Sub CommandButton1_Click()
If Documents.Count = 0 Then Documents.Add
Selection.Text = " " + TextBox1.Text + " " + TextBox4.Text + " , " + TextBox3.Text + ". " + TextBox5.Text + " *^2/ " + TextBox2.Text + " " + TextBox6.Text +
Selection.Collapse direction:=wdCollapseEnd
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub TextBox1_Change()
scet
End Sub
Private Sub TextBox2_Change()
scet
End Sub
Private Sub TextBox3_Change()
scet
End Sub
Private Sub TextBox4_Change()
scet
End Sub
Private Sub TextBox5_Change()
scet
End Sub
Private Sub scet()
If IsNumeric(TextBox1.Text) = True And
IsNumeric(TextBox2.Text) = True And
IsNumeric(TextBox3.Text) = True And
IsNumeric(TextBox4.Text) = True And
IsNumeric(TextBox5.Text) = True And Not Val(TextBox4.Text) = 0 And Not Val(TextBox5.Text) = 0 Then rez = ((Val(TextBox1.Text) ^ 2) * Val(TextBox2.Text) * Val(TextBox3.Text)) / (Val(TextBox4.Text) * Val(TextBox5.Text))
TextBox6.Text = Str$(rez)
CommandButton1.Enabled = True
Else
TextBox6.Text = ""
CommandButton1.Enabled = False
End If
End Sub
Word :
Selection.Font.Color =
wdColorRed
wdColorDarkRed
wdColorDarkTeal
wdColorBlue
wdColorGreen
wdColorBlack
wdColorOrange
|
|
Selection.Font.Bold =
wdToggle
Selection.Font.Italic=
wdToggle
Selection.ParagraphFormat.Alignment=
wdAlignParagraphRight
wdAlignParagraphCenter
wdAlignParagraphJustify
Selection.TypeText Text:=" "
Selection.TypeParagraph
Selection.Font.Size = 14
Image (). :
Autosize ( );
Picture , ;
pictureSizeMode ( , , );
PictureAligment (, , , );
pictureTilling .
, .
. . VBA , IsNumeric. Val, , ( ).
Str , , Val, , .
, Val Str , , .
Word
Word . . ( + Insert + Module) :
Sub counter()
userForm1.Show
End Sub
, Teplo. :
1. .
2. ( + ).
3. .
4. . . , .
5. ( VBA-).
6. .
7. , , ( ).
8. , .
9. .
5