Sub Main Dim h%, Doc$ h% = RTF.CreateHandle() 'open een nieuwe container Doc$ = "c:\testsjabloon.rtf" If RTF.LoadFile(h%, Doc$) Then DoWhile RTF.WordCount(h%, "@ADRES") > 0 RTF.ReplaceWord h%, "@ADRES", "testje!" EndIf EndIf Debug.Print RTF.SaveFile(h%, "c:\testdoc.rtf") RTF.CloseHandle h% 'sluit de container EndSub