I have only used vb6 three times so can't advise you about that.
Generally when doing a merge from outside Word I would recommend having a
merge template or document already existing. Use your outside process to set
up your data source and then open the merge document (or create a new
document based on your template). Run the merge to a new document.
I really don't have a clue as to what you are trying to do. Merge fields are
holders for data from a merge data source. As I said earlier, you can have
AutoText entries that hold such fields. It is unusual to be changing the
fields being used, but not unheard of. I have a template that uses different
paragraphs (including merge fields) depending on a choice checked by the
user when the document is first created.
If you are using only a single record and trying to automate insertion of
data from that record, you can use a merge. You can also simply assign your
pieces of data to variables in a vba procedure and place them in your
document at bookmarks or using DocVariable or DocProperty fields. Why are
you using a merge? Why do you need merge fields in AutoText rather than in
your document/template?
--
Charles Kenyon
See the MVP FAQ: <URL:
http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
John said:
Thanks Charles for your reply.
I have 2 more queries if you are aware:
1) Once the Autotextentries are copied into Word, how can I convert them
into mail merge fields from VB6. In fact how do I make this Word document a
mail merge document from VB6( I will use another Word document as its
Datasource) so that any time I open the file I can insert these merge fields
?