?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "利用word統計字數和檢查拼寫檢查"
ClientHeight = 4050
ClientLeft = 60
ClientTop = 345
ClientWidth = 6300
LinkTopic = "Form1"
ScaleHeight = 4050
ScaleWidth = 6300
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command2
Caption = "統計字數"
Height = 645
Left = 4575
TabIndex = 2
Top = 3000
Width = 1515
End
Begin VB.TextBox Text1
Height = 3645
Left = 240
MultiLine = -1 'True
TabIndex = 1
Text = "Form1.frx":0000
Top = 270
Width = 4155
End
Begin VB.CommandButton Command1
Caption = "拼寫檢查"
Height = 645
Left = 4560
TabIndex = 0
Top = 2280
Width = 1515
End
Begin VB.Label Label2
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 4650
TabIndex = 4
Top = 1320
Width = 1395
End
Begin VB.Label Label1
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 4650
TabIndex = 3
Top = 360
Width = 1395
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim myDoc As New Document
Private Sub Command1_Click()
myDoc.Range.Text = Text1
myDoc.Application.Visible = True
AppActivate myDoc.Application.Caption
myDoc.Range.CheckSpelling
Text1 = myDoc.Range.Text
Text1 = Left(Text1, Len(Text1) - 1)
AppActivate Caption
End Sub
Private Sub Command2_Click()
Dim wordDlg As Word.Dialog
myDoc.Range = Text1.Text
Set wordDlg = myDoc.Application.Dialogs(wdDialogDocumentStatistics)
wordDlg.Execute
Label1.Caption = "單詞數:" & Str(wordDlg.Words) & "詞"
Label2.Caption = "字符數:" & Str(wordDlg.Characters) & "字符"
End Sub
Private Sub Form_Unload(Cancel As Integer)
If myDoc.Application.Visible Then
myDoc.Close savechanges:=False
Else
myDoc.Application.Quit savechanges:=False
End If
End Sub
'
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -