Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
foamy foamy is offline
external usenet poster
 
Posts: 1
Default Datasources in Word 2007

Hi,

Here's my problem:

I have a template which contains editable fiels. I want to fill these fiels
with data from my SQL Server 2005. How can I do this? I've been searching,
trying and searching some more for roughly an hour now... I want to bind each
field to a query that will fill it with data from my database...

Please help...
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Datasources in Word 2007

I don't think any of the field types lets you bind to a data source in the
way I think you are looking for.

If you want to fill fields with data directly from SQL Server using built-in
facilities then I think your only options are
a. use old-style DATABASE fields
b. set your document up as a Mail merge main document with a SQL Server
data source and use Mailmerge fields to include the data. however, all the
data at any one time would then have to come from a single record in
whatever view or table you are using as your data source.

(a) used to be feasible, although probably impractical in most cases for
performance reasons, because if you specified a DATABASE field that only
displayed one value (i.e. one column, one row, no header) Word would show
the result as inline text rather than as a single-cell table. Now, however,
you cannot do this because the field result is always followed by a
paragraph mark. There is a workaround for dates and numbers (see e.g.
http://tips.pjmsn.me.uk/t0004.htm)

For something that looks more like "binding", you have to use Word 2007
content controls. But then you can only bind (as far as I know) to the
internal XML data store held as a "part" in the .docx file. In other words,
you have to populate that data store separately using (say) VB.NET, C# or
perhaps VBA code, but when you do, the content of the controls should
reflect the data in the store more or less immediately. But you can put
whatever you wantin the store, and populate it from wherever you want.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"foamy" wrote in message
...
Hi,

Here's my problem:

I have a template which contains editable fiels. I want to fill these
fiels
with data from my SQL Server 2005. How can I do this? I've been searching,
trying and searching some more for roughly an hour now... I want to bind
each
field to a query that will fill it with data from my database...

Please help...


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
Mail Merge from Multiple Datasources jws Mailmerge 3 March 22nd 08 09:54 PM
Default file location for datasources Victor[_2_] Mailmerge 3 March 25th 07 11:31 PM
My Datasources - default to location on server not c: ? Smudge Mailmerge 0 February 16th 07 11:48 AM
Word 2002 SP3 loses connection datasources Andrea Mailmerge 1 March 26th 06 09:26 PM
Win 2k: Multiple Datasources, one document Chris Mailmerge 2 March 22nd 05 11:35 PM


All times are GMT +1. The time now is 01:31 AM.

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"