Microsoft Word Error #5922
Contents |
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office word was unable to open the data source excel Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office
Word Was Unable To Open The Data Source 2013
365 REST APIs SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx word 2013 mail merge unable to open data source Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Error 5922 doing a mail merge with Word 2010 Microsoft word was unable to open the data source 2016 Office for Developers > Word for Developers Question 0 Sign in to vote I am using Visual Basic 9.0 (Visual Studio 2008). My application does a mail merge using Microsoft Word (connected to a Microsoft Access database). It works fine with previous version of Microsoft Word. However, it does not work with Microsoft Word 2010 for some reason. The
Word Was Unable To Open The Data Source Word 2010
merge fails on the call to .OpenDatasource which generates an error 5922 (Word was unable toopen the data source). The line that fails reads: wordDoc.MailMerge.OpenDataSource( "", , 0, 1, 1, 0, "", "", 0, "", "", odbcConnectString, sqlSelectStmt, "", , WDMergeSubTypeWord2000) the value of odbcConnectString is: DSN=Market Drive Staging;DBQ=C:\Users\Andy\AppData\Local\Temp\tmpC30F.tmp;DefaultDir=C:\Users\Andy\AppData\Local\Temp\;DriverID=25;FIL=MS Access;MaxBufferSize=4096;PageTimeout=5;UID=Admin;PWD= the value of sqlSelectStmt is: SELECT * FROM `RELettersMailMerge` ORDER BY `Order` To repeat, this works just fine with Word 2007 and Word 2003. Any ideas would be greatly appreciated. andy Moved by Martin_Xie Monday, October 18, 2010 11:32 AM Move it to Word Development Forum for better support. (From:Visual Basic General) Saturday, October 16, 2010 2:11 AM Reply | Quote Answers 0 Sign in to vote HI Cindy. I used the macro trick to get a connection string that would work and then I changed one thing at time to figure out why my original code did not work. Here is what I found. 1. Office 2010 requires that the 'DatabaseName' parameter is filled in. This was not expected because teh connection st
VBA Code & Other Help Word Help Run-time error '5922' - Mail Merge If this is your first visit, be sure to check out the FAQ by clicking the link above. You word was unable to open the data source mac may have to register before you can post: click the register link word 2013 word was unable to open the datasource above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Word Was Unable To Open The Data Source Mail Merge Access
Page 1 of 5 1 2 3 ... Last Jump to page: Results 1 to 20 of 82 Thread: Run-time error '5922' - Mail Merge Thread Tools Show Printable Version https://social.msdn.microsoft.com/Forums/office/en-US/02d95732-6853-41e9-8d19-4ad5237a1845/error-5922-doing-a-mail-merge-with-word-2010?forum=worddev Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 02-20-2014,07:39 AM #1 dirtychinch View Profile View Forum Posts View Blog Entries Visit Homepage View Articles VBAX Regular Joined Feb 2014 Location Ashford, Surrey, UK Posts 64 Location Run-time error '5922' - Mail Merge Afternoon all, Sorry for the mislead title - I had that error previously http://www.vbaexpress.com/forum/showthread.php?48989-Run-time-error-5922-Mail-Merge and will probably have it again, but another hump got in the way, so I amended my post. I'm trying to set up a mail merge from Excel to Word. I've got it working manually, but need to automate the process for our users. I have the macro below run in an AutoNew sub, when the document opens. However, every time I try and use it, after one clicks Yes to continue with the mail merge, it comes up with the error "Object doesn't support this property or method." Sub MailMerge() Dim SourceDoc As String Dim SelectedItems(1) As String With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False If .Show <> 0 Then SelectedItems(1) = SourceDoc Else Exit Sub End If End With ActiveDocument.MailMerge.OpenDataSource Name:=SourceDoc, _ ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _ Format:=wdOpenFormatAuto, Connection:= _ "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=H:\Jonathon Hunter Hill\Mail Merge\AirMaster V 0.9.xlsm;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Engine Type=35;Jet OLEDB:" _ , SQLStatement:="SELECT * FROM `MailMerge$`", SQLStatement1:="", SubType _ :=wdMergeSubTypeAccess End Sub Formatting tags added by mark007 If I click No to the question of whether I want to carry ou
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project https://www.experts-exchange.com/questions/26803411/Error-5922.html Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts http://stackoverflow.com/questions/6654651/run-time-error-5922-when-running-mail-merge-in-word-connecting-to-sql2005-db-vi Exchange > Questions > Error 5922 Want to Advertise Here? Solved Error 5922 Posted on 2011-02-07 MS Access MS Word MS Office 1 Verified Solution 10 Comments 923 Views Last Modified: unable to 2012-05-11 I have a mailmerge between access and word bu I am getting error 5922 ' word cannot open datasource. I m usig office 2010 and I don;t lnow if odbc drivers had to be installled. here's the connection.. Set wrdapp = CreateObject("Word.Application") Set worddoc = wrdapp.Documents.Add(Template:=myTemplate, NewTemplate:=False, DocumentType:=0) worddoc.MailMerge.OpenDataSource Name:="C:\Event\Boat.accdb", LinkToSource:=True,TABLE [tblBoat],SQLStatement=strsql 0 Question by:zachvaldez unable to open Facebook Twitter LinkedIn Google LVL 74 Best Solution byJeffrey Coachman There are lots of links here demonstrating how to Mail Merge from MS Access http://www.google.com/search?q=site%3Awww.experts-exchange.com+mail+merge+from+Ms+Access But keep this Q open for a few Go to Solution 10 Comments LVL 74 Overall: Level 74 MS Access 72 MS Office 15 MS Word 6 Message Expert Comment by:Jeffrey Coachman2011-02-07 To do a normal Mail merge in Word with an Access table/query as the source requires no code. If you do this manually, does it work? 0 Message Active 5 days ago Author Comment by:zachvaldez2011-02-07 yes 0 Message Active 5 days ago Author Comment by:zachvaldez2011-02-07 I'd like to place it in a button clivk 0 LVL 74 Overall: Level 74 MS Access 72 MS Office 15 MS Word 6 Message Accepted Solution by:Jeffrey Coachman2011-02-07 There are lots of links here demonstrating how to Mail Merge from MS Access http://www.google.com/search?q=site%3Awww.experts-exchange.com+mail+merge+from+Ms+Access But keep this Q open for a few days more in case another expert has a more targeted solution. 0 Message Active 5 days ago Author Comment by:zachvaldez2011-02-07 Thanks! I did not
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up run-time error 5922 when running mail merge in Word, connecting to SQL2005 db via ODBC up vote 1 down vote favorite I am trying to support an ancient Word template that uses VBA to implement a mail merge. It connects to a SQL2005 via an ODBC connection that is configured to use NT authentication. The template uses bookmark to capture a record ID that is then passed to the SQL query, strSQL. When I run the mail merge, I can see that the query makes it to the db, and that the query also produces a result set. However, I'm getting a "Run-time error '5922'; Word was unable to open the data source." If I try to run the Debugger, the .OpenDatasource method (is that the right term? I'm not very familiar with VBA) is the one Word highlights as the offending code. The MailMerge code looks like this: With ActiveDocument.MailMerge .MainDocumentType = wdFormLetters constr = "DSN=production_datamart;DBQ=datamartDBQ;" & _ "uid=username;" & _ "pwd=userpass;" '****************************************************** .OpenDataSource Name:=strSQL, _ Connection:=constr, SQLStatement:=strSQL .Destination = wdSendToNewDocument .MailAsAttachment = False .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=True With Options .PrintDrawingObjects = True End With .Parent.MailMerge.MainDocumentType = wdNotAMergeDocument .Parent.Close SaveChanges:=wdDoNotSaveChanges End With And yes, you're reading that correctly, the code specifies a SQL authentication username and password, despite connecting via the ODBC with NT creds. sql-server-2005 vba ms-word odbc share|improve this question edited Mar 9 '12 at 4:37 Joel Coehoorn 249k92440662 asked Jul 11 '11 at 18:22 digital.aaron 62 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Your Answer draft saved draft discarded Sign up or log