Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

Problems opening a mailmerge document from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy Davis - 29 May 2005 15:33 GMT
Hi

I've written the following code for a button on a form to open a mail merge
document in MS Word. The code opens the document fine but does not display
the usual connection details to open the table in my database when the file
is opened.i.e:
"Opening this document will run the following SQL command:
   SELECT * FROM 'filename' "
Hence all that is opened is a document with no updated details from the
source table. If I open the document directly in Word it works OK.
                                                                           
       -----------------------------------
VBA Code in Access form:

On Error GoTo Err_SettLett_Word_Click
'declare variables
'object variable that refers to Word
   Dim appWord As Object

   'Word.Application data type established from reference to Word's object
library
   Set appWord = CreateObject("Word.Application")
   'make Word visible
   appWord.Visible = True

'Open Word document
With appWord
  .Documents.Add "C:\DD\Database work\GCRE\settlement_lett.doc"
End With
                                                                           
       ----------------------------------

Any help much appreciated.

Thanks in advance

Dawn
Albert D.Kallal - 30 May 2005 00:18 GMT
It might be your machine settings.

Give my sample word merge a try here:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

if the above works for  you..then you can look at the code....

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.