Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjhZQ-0003Ei-Ne for pgsql-odbc@arkaria.postgresql.org; Wed, 07 Oct 2015 05:47:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZjhZQ-0003oi-0w for pgsql-odbc@arkaria.postgresql.org; Wed, 07 Oct 2015 05:47:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZjhZP-0003ob-Ln for pgsql-odbc@postgresql.org; Wed, 07 Oct 2015 05:47:19 +0000 Received: from mbob.nabble.com ([162.253.133.15]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZjhZH-0000pR-8G for pgsql-odbc@postgresql.org; Wed, 07 Oct 2015 05:47:18 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 541FE172059B for ; Tue, 6 Oct 2015 22:39:50 -0700 (PDT) Date: Tue, 6 Oct 2015 22:47:07 -0700 (MST) From: "david.paulo" To: pgsql-odbc@postgresql.org Message-ID: <1444196827343-5869049.post@n5.nabble.com> In-Reply-To: <00bc01c75d00$fcbd5c40$0d01a8c0@karlsdesktop> References: <00bc01c75d00$fcbd5c40$0d01a8c0@karlsdesktop> Subject: Re: ODBC problem with Microsoft Word and Excel MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org Here is what I needed to do 1) Use ANSI odbc driver - this is key - Unicode does not work - I am using version 9.03.04.00. In this example the name of the odbc DSN is LFData. It has a username and password embedded in it. 2) It may not be needed for word merge (I am also doing separate queries) but I registered Microsoft ActiveX Data Objects 6.1 Library from the VBA Tools menu 3) Within the macro that performs the merge I have the following (xcfPax is a view that provides the fields for the merge): SQLRequest = "select * from xcfPax where matterno = '" & matterRef & "'" Doc.MailMerge.MainDocumentType = wdFormLetters Doc.MailMerge.Destination = wdSendToNewDocument Doc.MailMerge.OpenDataSource _ Name:="", _ SQLStatement:=SQLRequest, _ AddToRecentFiles:=False, _ Connection:="DSN=LFData", _ SubType:=wdMergeSubTypeWord2000 ' Execute the mail merge. Doc.MailMerge.Execute Doc.MailMerge.DataSource.Close -- View this message in context: http://postgresql.nabble.com/ODBC-problem-with-Microsoft-Word-and-Excel-tp2189996p5869049.html Sent from the PostgreSQL - odbc mailing list archive at Nabble.com. -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc