How to avoid Message Popups in MS-WORD macros?
Thread poster: MikeTrans
MikeTrans
MikeTrans
Germany
Local time: 18:50
Italian to German
+ ...
Jun 2, 2012

Hi,

I'm just trying to enhance my auto-write program. For that purpose I've recorded a macro in MS-WORD to glue words together like

here are glued words
here_are_glued_words

I've created a macro in order to just select a multi-word expression and press a shortcut. It works fine.
However, In the macro I have to carry out a search/replace and unfortunately when running the macro, the messages always comes

"Do you want to search to the
... See more
Hi,

I'm just trying to enhance my auto-write program. For that purpose I've recorded a macro in MS-WORD to glue words together like

here are glued words
here_are_glued_words

I've created a macro in order to just select a multi-word expression and press a shortcut. It works fine.
However, In the macro I have to carry out a search/replace and unfortunately when running the macro, the messages always comes

"Do you want to search to the end of the document? Press Yes - No"
or
"5 instances have been changed. Press OK"

Is there any method in a MS-WORD macro to impede those prompts? Or: how do I have to edit the macro to skip these prompts?

Here is the macro's code:

------------------------------------------------------------------------------------------------------------------
Sub Mike_Test()
'
' Mike_Test Makro
' Makro aufgezeichnet am 02.06.2012 von Mike xxxxxx
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.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
Selection.Copy
Selection.MoveRight Unit:=wdCharacter, Count:=1
Application.Run MacroName:="Fusion.Protection.ProtectBackSpace"
Selection.TypeText Text:=" "
End Sub
--------------------------------------------------------------------------------------------------

Thanks very much any ideas,
Greets,
Mike
Collapse


 
MikeTrans
MikeTrans
Germany
Local time: 18:50
Italian to German
+ ...
TOPIC STARTER
Got it!... Jun 2, 2012

The solution:
I must replace the "wdFindAsk" into "wdFindStop".
After some searching I found that in the Object Catalogue.

Greets,
Mike


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

How to avoid Message Popups in MS-WORD macros?






Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »