W
Wayne_Perth_WA
The follwing code works in excel but not in word?
It basically checks the user name.
checks to see if user name is either "Name1" or "Name2"
If the name is either of these it lets the document be open other wise the
document closes.
Any Ideas as to why it will not work?
Private Sub Document_Open()
User = Application.UserName
Application.DisplayAlerts = False
If (User = "Name1") Or (User = "Name2") Then Beep Else Application.Quit
Application.DisplayAlerts = True
End Sub
It basically checks the user name.
checks to see if user name is either "Name1" or "Name2"
If the name is either of these it lets the document be open other wise the
document closes.
Any Ideas as to why it will not work?
Private Sub Document_Open()
User = Application.UserName
Application.DisplayAlerts = False
If (User = "Name1") Or (User = "Name2") Then Beep Else Application.Quit
Application.DisplayAlerts = True
End Sub