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 / July 2005

Tip: Looking for answers? Try searching our database.

Getting data from Access to Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fr@nk - 18 Jul 2005 14:49 GMT
Hi all,

I'm quite a newbee, so please excuse me if I ask something that's very
obvious to you ;-)

Right now I've made a Word-template, in which data is retrieved from an
Access database using ADODB. The queries are defined in Word, and this is not
the best way.
Better would be if the Word-template uses queries defined in the Access
database, and that the Word template itself was called from within Access (by
a commandbutton on a form). Is there a way of doing this?

Another possibility could be that with a commandbutton_click, a new Word
document is made, based on the existing Word template; how would I do this?

BTW: I'm using Office XP.

Thanks in advance! Any help much appreciated!

Cheerio,

Fr@nk
Ofer - 18 Jul 2005 14:57 GMT
Search the post "Export current record to word", there is an example how to
use word with bookmarks
==================================================
Create A word document, insert book marks where you want the value from
access should be insert, and then run this code

Public Sub PrintToWord()
Dim wd As Word.Application
Dim myDoc As Word.Document

Set wd = New Word.Application
wd.Documents.Add DOTpath & reportName & ".dot"   ' The name and path
Set myDoc = wd.ActiveDocument
With wd.Selection
           .GoTo wdGoToBookmark, Name:=BookMarkName  ' The name of the book
mark
           .Font.Bold = True  ' You can choose if bold
           .Font.Underline = False  ' or underline
           .TypeText Text:=ValueToInsertInTheBookMark  ' insert values
   End With
   wd.Visible = True

End Sub

> Hi all,
>
[quoted text clipped - 18 lines]
>
> Fr@nk
Albert D.Kallal - 18 Jul 2005 15:53 GMT
I have a nice sample working that allows you to merge the current record to
word, and much much more.

Try downloading the sample here:

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

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.