Word VBA >> Answering a MsgBox with VBA code?

by Fred Holmes » Wed, 28 Jul 2004 02:38:02 GMT

The following recorded keystroke macro:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/27/2004 by xxxxx
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Fails to record the last user action, clicking on the "No" option of
the MsgBox that inquires "Word has finished searching the selection,
would you like to search the remainder of the document?"

Is there a vba statement that I can manually add that will
automatically answer "No" to that MsgBox?

Thanks,

Fred Holmes


Word VBA >> Answering a MsgBox with VBA code?

by MSizlak » Wed, 28 Jul 2004 02:53:44 GMT


Just set the .Wrap property to wdFindStop. Then the
dialog won't even pop up.
Moe

the "No" option of
the selection,
will



Word VBA >> Answering a MsgBox with VBA code?

by Fred Holmes » Wed, 28 Jul 2004 03:16:55 GMT

Many thanks! Works like a charm!

Fred Holmes

On Tue, 27 Jul 2004 11:53:44 -0700, "MSizlak"





Similar Threads

1. VBA Code for selecting a wordart object (answer)

Dim sh as shape
Dim rng as Range

Set rng = selection.range

' choose the wordart and formatting

set sh = activedocument.shapes.addtexteffect(msotexteffect1, _
  "presettexteffect xx", "arial", 24, false, false, _ 
   0,0, rng)

' send behind text

sh.zorder msoSendBehindText

2. a MsgBox with answer - MS Word&VBA

3. closing msgbox in vba code

I am stuck
I have developed an access app wich under certain circumstances will display 
a msgbox using the standard msgbox function. I am now trying to implement 
timers for the application as a whole so that it is automatically closed if 
the user does nothing for 80mins. The problem I have is that I cannot 
sucessfuly use application.quit if a msgbox has currently got the focus. Is 
there anyway I can close it from within the vba timer module? I suspect this 
may need an api call ie enumerate child windows etc but how do you tell that 
a msgbox has currently got the focus and what the hwnd is?

thanks in advance
stephen


4. close msgbox with VBA code

5. active msgbox function in excel via vba code from access

hi all,
im trying to open a messagebox in excel via code from access,
didnt find a solution yet
does anyone have idea?

6. VBA code in other template to update Normal.dot VBA code

7. Insert VBA Code With VBA Code

How I can use vba code to insert vba code into another document?




8. run msgbox code in Word from Access - Access Forms Programming