using macro from word97 in word2000

M

mario

how can i use a macro from word97 in word2000?
the message i obtain is that source record has too many
fields...
thanks
mario
 
C

Cindy Meister -WordMVP-

Hi Mario,

Could you copy/paste the macro code into a reply, please?

And do indicate on which line the error is occurring.

What is the data source? (Excel, text file, Access, or?)
how can i use a macro from word97 in word2000?
the message i obtain is that source record has too many
fields...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

mario

hi cindy,
the source is a text file [identical in 97 and 2000] and
the error occurs here

nome_documento =
ActiveDocument.MailMerge.DataSource.DataFields
("Nome_File").Value & ".doc"

because fields' names are read as a unique long string.
in another macro, at the same statement, with 2000, i
found the source field's name in the field's value.
thanks for your attention
mario
 
C

Cindy Meister -WordMVP-

Hi Mario,

The one thing I could imagine is that Word is having
trouble identifying the the field name properly. It stands
as Nome_File in the text file, exactly like that?

And if you go into the Word mail merge interface and click
the "Insert Merge Field" button to see the list of fields
that can be inserted, does it appear exactly the same way
in this list? Or has Word altered something?
the source is a text file [identical in 97 and 2000] and
the error occurs here

nome_documento =
ActiveDocument.MailMerge.DataSource.DataFields
("Nome_File").Value & ".doc"

because fields' names are read as a unique long string.
in another macro, at the same statement, with 2000, i
found the source field's name in the field's value.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

mario

hi cindy,
you asked:
And if you go into the Word mail merge interface and
click the "Insert Merge Field" button to see the list of
fields that can be inserted, does it appear exactly the
same way in this list? Or has Word altered something?

in the list there is only one name but not selectable.
the macro code works well, the problem is the mailmerge...
thanks
mario
 
C

Cindy M -WordMVP-

Hi Mario,
in the list there is only one name but not selectable.
the macro code works well, the problem is the mailmerge...
If the field name you are trying to use isn't available in
the list of merge fields, then you certainly cannot use it
in a macro like this

ActiveDocument.MailMerge.DataSource.DataFields
("Nome_File").Value

You first need to get the mailmerge set up so that it
correctly recognizes the fields as fields. So let's back up
a step here: what is your data source? A text file? An Excel
sheet? Something else?

What connection method are you using to link up to it? If
you do not know, and you are using VBA to link, please show
us the OpenDataSource code you're using.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top