Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Adam Froio
 
Posts: n/a
Default Using an .odc File to Mailmerge with SQL Server

Hi,

I'm using an .odc file to pull data from SQL Server 2000 into a Word 2003
mailmerge.

My problem is getting the syntax correct so that I can dynamically create
sql statements to use for the merge.

For example, this works:
Word.MailMerge.OpenDataSource Name:="c:\mailmerge\CustomerData.odc",
SQLStatement:="SELECT * FROM [vwCustomerData]"

This, however, does not:
Word.MailMerge.OpenDataSource Name:="c:\mailmerge\vwCustomerData.odc",
SQLStatement:="SELECT * FROM [vwCustomerData] WHERE State = 'CT'"

I can't seem to find more than a couple examples on how to use an .odc in
this way and I can find none that use a sql statement any more complicated
than the first example above.

Any help or advice would be very much appreciated.

Thanks!
Adam


 
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 merg file list auroracrum Mailmerge 3 March 11th 05 09:45 PM
mailmerge - excel datasource - other file extension? Ralf Pickel Mailmerge 1 February 14th 05 09:05 PM
mailmerge from excelfile with different file extension Ralf Pickel Mailmerge 0 January 31st 05 09:39 AM
MailMerge with Access File - need to format currency TheMomBon Mailmerge 1 January 26th 05 05:47 PM
Mailmerge Recipients doesn't work with SQL Server Gelatinous_Blob Mailmerge 2 December 17th 04 06:34 PM


All times are GMT +1. The time now is 10:04 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"