nhờ viết code tạo mật khẩu trong word

Liên hệ QC

tamnguoiban

Thành viên mới
Tham gia
14/5/09
Bài viết
4
Được thích
0
Em đang viết một đoạn code tạo pass trong word

Nhưng không chạy đươc

Nhờ các anh chị trong diễn đàn hổ trơ giúp em với

Em cảm ơn các anh chị nhiều

Const Pwd = "helo"
Const Usr = "123"
Private Sub ComboBox1_Change()
End Sub
Private Sub Combo_Change()
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
If PasswordTextBox.Text = Pwd And UserCombo = Usr Then
Me.Height = 162
Main
Else
MsgBox "Khong dung Password!", vbCritical + vbInformation, "Thong bao"
thoat
End If
End Sub
End Sub
Private Sub CommandButton2_Click()
On Error Resume Next
Application.Quit
End Sub
Private Sub Label1_Click()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub thoat_Click()
Unload Me
End Sub

Sub Main()
On Error Resume Next
Application.ScreenUpdating = False
Pages.Add.Name = "TT"
Dim Counter As Integer
Dim RowMax As Integer, ColMax As Integer
Dim r As Integer, c As Integer
Dim PctDone As Single
If TypeName(Activepages) <> "document" Then Exit Sub
Cells.Clear
Application.ScreenUpdating = False
Counter = 1
RowMax = 1300
ColMax = 25
For r = 1 To RowMax
For c = 1 To ColMax
Cells(r, c) = Int(Rnd * 1300)
Counter = Counter + 1
Next c
PctDone = Counter / (RowMax * ColMax)
With UsersName
.FrameProgress.Caption = Format(PctDone, "0%")
.LabelProgress.Width = PctDone * (.FrameProgress.Width - 10)
End With
DoEvents
Next r
Pages("TT").Select
Application.DisplayAlerts = False
ActiveWindow.Selectedwordbooks.Delete
Unload UsersName
End Sub
 
Em đang viết một đoạn code tạo pass trong word

Nhưng không chạy đươc

Nhờ các anh chị trong diễn đàn hổ trơ giúp em với

Em cảm ơn các anh chị nhiều
Tiếc gì mà bạn không đưa file đó lên đây nhỉ? Chỉ đưa một loạt code lên thì ai biết mặt mũi cái form của bạn ra sao, trong file của bạn có gì mà sửa?
Hơn nữa, post bài này vào chuyên mục này là sai box đấy.
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom