L
LDMueller
We're using Word 2003. I have a Userform with the following code:
Private Sub CommandButton1_Click()
UserForm1.Hide
End Sub
Private Sub OptionButton1_Click()
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.MoveUp Unit:=wdLine, Count:=1
End Sub
Private Sub OptionButton2_Click()
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.MoveUp Unit:=wdLine, Count:=1
End Sub
The way it works is if a user select CommandButton2, it's suppose to go to
the end of the next page. This part works fine. My problem is that once a
user selects CommandButton2, it stays on that button so that it can't be
selected again and my user may need to select it several times before
locating the correct page. No matter what I do, I can't release the focus
after it's selected so that it can be selected again.
I've tried working with setfocus and releasefocus, but haven't had any luck.
Can you assist me?
Thanks!
Private Sub CommandButton1_Click()
UserForm1.Hide
End Sub
Private Sub OptionButton1_Click()
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.MoveUp Unit:=wdLine, Count:=1
End Sub
Private Sub OptionButton2_Click()
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, Name:=""
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.MoveUp Unit:=wdLine, Count:=1
End Sub
The way it works is if a user select CommandButton2, it's suppose to go to
the end of the next page. This part works fine. My problem is that once a
user selects CommandButton2, it stays on that button so that it can't be
selected again and my user may need to select it several times before
locating the correct page. No matter what I do, I can't release the focus
after it's selected so that it can be selected again.
I've tried working with setfocus and releasefocus, but haven't had any luck.
Can you assist me?
Thanks!