Word: search and replace

I have this code for a full search and replace (Office 2013).

[code] Dim find as WordFind
find = app.word.selection.find

Find.Text = zoekWoord
Find.Replacement.Text = vervangWoord
Find.Forward = True
Find.Wrap = Office.wdFindContinue
Find.Format = False
Find.MatchCase = False
Find.MatchWholeWord = False
Find.MatchWildcards = False
Find.MatchSoundsLike = False
Find.MatchAllWordForms = False

Dim replaceParam as new OLEParameter

replaceParam.Value = Office.wdReplaceAll
replaceParam.Position = 11

Find.Execute( replaceParam)

The find.execute raises a OLEException error with errorcode: Exception code 0: Function not available - failed on “Execute”.

This code is in the Office Automation example. Has the order of Replace parameters changed in Office 2013?

If I record a macro in Word 2013 for search and replace, the ReplaceAll parameter is constant.

Sub ZoekEnVervang() ' ' ZoekEnVervang Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "jskjhskdghksdhgkjhsdg" .Replacement.Text = "fafasfaf" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub

How to use that constant?

I bought Eugene Dakin’s “I wish I knew how to program Word 2010 with Xojo in Windows”.

All my problems gone!! Very good Eugene.
A must-have for the Office programmer.