How to avoid Message Popups in MS-WORD macros?
Autor wątku: MikeTrans
MikeTrans
MikeTrans
Niemcy
Local time: 15:25
włoski > niemiecki
+ ...
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
Niemcy
Local time: 15:25
włoski > niemiecki
+ ...
NOWY TEMAT
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?






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
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 »