Mail Merge issue with Word 2003

S

Srinivasan.B

1) We print communication letter to customers using Mail merge
2) Our Application based Oracle and Forms6i
3) It was working fine until Windows upgraded with Word 2003
4) With Word 2003, Letter is not printed. Only Data source coming out, Mail
merge
didn't happen.
5) Please suggest the solution such way that it works with both versions.
 
G

Graham Mayor

Mail merge was completely revised after Word 2000.
http://www.gmayor.com/mail_merge_labels_with_word_xp.htm explains how to
get it back to near what you are used to - especially see the Excel data
section which bears similar issues. If you have a custom macro drive
application then it is going to have to be revised to take account of the
changes and is unlikely to work in both versions.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Srinivasan.B

Hi,

Let me explain the scenario clearly so that the cause of the error is clear.

We are invoking this from a Developer 2000 Application written in PL/SQL.
The code to do the same is reproduced below.

--open the data source

APPLICATION := OLE2.CREATE_OBJ('Word.Basic');
-- Open the mail merge data source document
OLE2.SET_PROPERTY(application, 'Visible', 'False');
ARGS:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(ARGS, M_DS_PATH);
OLE2.INVOKE(APPLICATION, 'FileOpen', ARGS);
OLE2.DESTROY_ARGLIST(ARGS);


--invoke the application to show the document
ARGS:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(ARGS, M_SRC_FILE_PATH||'\'||M_RS_REPORT_NAME);
OLE2.INVOKE(APPLICATION, 'FileOpen', ARGS);
OLE2.DESTROY_ARGLIST(ARGS);

-- Perform the mail merge to create the merged document
OLE2.INVOKE(APPLICATION,'MailMergeToDoc');

We would like to know why this fails in Word 2003 whereas it works in Word
2000. Is there any repository which explains the changes done to Word 2003
w.r.t Mail Merge.

Thanks and regards,

Srinivasan
 
P

Peter Jamieson

I suspect that this problem occurs for one of the following three reasons:
a. changes in security - see
http://support.microsoft.com/default.aspx?scid=kb;en-us;825765 . In essence,
when you open a merge document programmatically, the connection to the data
source usually fails, and that will be without warning if the error is not
trapped
b. changes in the way Word connects to data sources - specifically, there
is an additional parameter in OpenDataSource calls that you have to use if
you want to use the older Word 2000 methods. (Actually I doubt that this is
relevant in this case unless you are connecting to the data source
programmatically)
c. (maybe) changes to Word 2003 related to the way old WordBasic routines
are executed. I am not aware of any such changes but it would not surprise
me if they existed.

Peter Jamieson
 
K

klith2003

have you finally found a solution to this issue because I 'm facing the
same problem.
 
D

Doug Robbins - Word MVP

What was the problem?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

The same problem probably means something to you, but it does not to me and
probably does not to anyone else who frequents these newsgroups.

Tell us what it is and we will try and help.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

eufemia

Well, the next function was 100% in oracle form6i with word 2000 and th
same function does not work with word 2003

...
application:=OLE2.CREATE_OBJ('Word.Basic')

args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, 'Fields.doc')
OLE2.INVOKE(application, 'FileOpen', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')
OLE2.INVOKE(application, 'NextCell')

FOR CL_REC IN C1 LOO

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.NAME)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.ADDRESS)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.LOCAL)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.POST_CODE)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.POST_CODE_EXT)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.POST_DESCRIPTION)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.MOVIE)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'NextCell')
args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, CL_REC.CATEGORY)
OLE2.INVOKE(application, 'Insert', args)
OLE2.DESTROY_ARGLIST(args)

END LOOP

args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, 'Mask.doc')
OLE2.INVOKE(application, 'FileOpen', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'MailMergeToDoc')

args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, 'Mail_Out.doc')
OLE2.INVOKE(application, 'FileSaveAs', args)
OLE2.DESTROY_ARGLIST(args)

args:=OLE2.CREATE_ARGLIST
OLE2.ADD_ARG(args, 2)
OLE2.INVOKE(application, 'FileCloseAll', args)
OLE2.DESTROY_ARGLIST(args)

OLE2.INVOKE(application, 'AppClose')
OLE2.RELEASE_OBJ(application)
..

The file 'Fields.doc' is a word doc with tables that is filled wit
data
The file 'Mask.doc' is a template word doc with fields connected t
'Fields.doc' to do the merge
The file 'Mail_Out.doc' is suposed to be the mailing itself. but wit
word2003 this 'Mail_Out.doc' only have the template and the name of th
filds that suposed to be merged, withou the data from merge

Thak's for your answer
 
P

Peter Jamieson

The chances are that with Word 2003 you need to take account of the
following article:

http://support.microsoft.com/kb/825765/en-us

Although there could also be an issue with the use of the Word.Basic object
and you might need to change your code to use the Word.Application object,
I'd try making the registry modification described in the article on a test
system first, to see if that's enough.

Peter Jamieson
 

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