A
AnnP
When I do a mail merge the text form fields disappear. I
looked at the knowledge base article 146644 that describes
this known problem. It gives an example of a fix but I
can't get it to work. I am using Word2000. Here is the
code I pasted into a macro and attempted to run on the
merged document. When I debug it highlights
StartOfDocument and I get the error "compile error: sub or
function not defined"
Sub MAIN
StartOfDocument
' Turn screen updating off.
ScreenUpdating 0
' Note that "<TEXTFIELD>" (below) needs to be
whatever the user has
' as a temporary text form field "replacement" in
their original
' merge document.
EditFind .Find = "<TEXTFIELD>", .Direction =
0, .Wrap = 1
' This makes sure that there are actually
more "fields" to replace
' before putting in a new form field. Without this
it would endlessly
' insert text form fields at the end of the document.
While EditFindFound()
InsertFormField .Enable = 1, .TextType =
0, .TextWidth = "0"
EditFind
Wend
ScreenUpdating 1 'Turn screen updating back on.
StartOfDocument
End Sub
I did the same thing with another macro that divides the
merged document into separate documents and that worked
fine.
looked at the knowledge base article 146644 that describes
this known problem. It gives an example of a fix but I
can't get it to work. I am using Word2000. Here is the
code I pasted into a macro and attempted to run on the
merged document. When I debug it highlights
StartOfDocument and I get the error "compile error: sub or
function not defined"
Sub MAIN
StartOfDocument
' Turn screen updating off.
ScreenUpdating 0
' Note that "<TEXTFIELD>" (below) needs to be
whatever the user has
' as a temporary text form field "replacement" in
their original
' merge document.
EditFind .Find = "<TEXTFIELD>", .Direction =
0, .Wrap = 1
' This makes sure that there are actually
more "fields" to replace
' before putting in a new form field. Without this
it would endlessly
' insert text form fields at the end of the document.
While EditFindFound()
InsertFormField .Enable = 1, .TextType =
0, .TextWidth = "0"
EditFind
Wend
ScreenUpdating 1 'Turn screen updating back on.
StartOfDocument
End Sub
I did the same thing with another macro that divides the
merged document into separate documents and that worked
fine.