Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
b.schmidt b.schmidt is offline
external usenet poster
 
Posts: 4
Default datasource is in use - can't connect to database

hi,

I wrote a Word 2007 Add-In in C#, which imports my recipients from a csv
file I created.

This is the code I use:

--------- doc.MailMerge.OpenDataSource(addressFileName, ref formatObj,
ref trueObj, ref trueObj, ref trueObj, ref falseObj,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref falseObj, ref missing);
---------

This works fine, but when I want to send out the mailmerge, or want to
edit specific records, an error message pops up, which says that it
can't connect to the database. But when clicking ok, all fields are
filled out, as it should be.. ?!?

I found out, that Word is locking my csv-file with the contacts (so that
you cannot rename or delete the file). Maybe this is the problem,
because when I want to print or edit specific records (which is a new
Word window), it seems to create a new instance of Word and can't open
the CSV-file because it is already used by my initial Word window.

Any ideas how to solve this issue?

best regards,
Bernhard
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
b.schmidt b.schmidt is offline
external usenet poster
 
Posts: 4
Default datasource is in use - can't connect to database [solved]

ok, forget it. :P

I had a CSV field "CampaignEntryID", and as it seems the Business
Contact Manager thought that the recipient list belogns to him and he
tried to connect to a datase.

I just took this field away, and now it works.

best regards,
bernhard

b.schmidt, am 27.04.2007 13:06:
hi,

I wrote a Word 2007 Add-In in C#, which imports my recipients from a csv
file I created.

This is the code I use:

---------
doc.MailMerge.OpenDataSource(addressFileName, ref formatObj,
ref trueObj, ref trueObj, ref trueObj, ref falseObj,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref falseObj, ref missing);
---------

This works fine, but when I want to send out the mailmerge, or want to
edit specific records, an error message pops up, which says that it
can't connect to the database. But when clicking ok, all fields are
filled out, as it should be.. ?!?

I found out, that Word is locking my csv-file with the contacts (so that
you cannot rename or delete the file). Maybe this is the problem,
because when I want to print or edit specific records (which is a new
Word window), it seems to create a new instance of Word and can't open
the CSV-file because it is already used by my initial Word window.

Any ideas how to solve this issue?

best regards,
Bernhard

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
database saved as a document, somehow, must convert to database Tasha Mailmerge 5 August 1st 05 08:01 PM
Word macro to connect to Oracle database ricaforrica Microsoft Word Help 1 June 22nd 05 05:24 PM
Can I Mail Merge from SQL Database without an odc datasource? Robert Jones Mailmerge 2 June 1st 05 03:27 PM
Database Connect String SteveTrue Mailmerge 3 March 26th 05 11:20 AM
Using Secured Access Database as Datasource Josh Mailmerge 2 January 18th 05 01:33 PM


All times are GMT +1. The time now is 08:56 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"