Preguntas más frecuentes

Preguntas frecuentes de autoayuda.

Eche un vistazo rápido a las preguntas (y respuestas) comunes en la lista predeterminada. Si no puede encontrar lo que está buscando, comience seleccionando su versión Ability Office y luego redúzcalo ingresando el texto de búsqueda y/o la categoría.

Artículo de la base de conocimiento 98

How to search and replace in Write

Suppose you had a template and wanted to search and replace a "field holder" with some text of your own. For example, in your document you type *namefld* where you want a user name to appear and *addfld* where the address should appear. The following subroutine implements a search and replace in the active document:

Sub FindAndReplace(find, replace)
Set mydoc = ActiveDocument
stxt = mydoc.Text.Mid(0, mydoc.Text.Count)

i = InStr(stxt, find) - 1
n = Len(find)
If (i > 0) Then
mydoc.Text.Delete i, n
mydoc.Text.Insert i, replace
End If
End Sub

And the following subroutine calls the above sub with some real data:

Sub TestReplace
FindAndReplace "*namefld*", "Phil Roach"
FindAndReplace "*addfld*", "Ability, London, England"
End Sub