Exporting Info To Word File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you export information from access into a word document? Such as a
company's name & Address in a certain place in the word document. As well as
what they ordered in another place, and their payment terms in another. I
believe to have the queries correct, but from there i import the database in
word using the database toolbar. There has to be an easier way. Can anyone
help??
 
Mailmerge is often the simplest way. Otherwise, you can use bookmarks or
formfields in a Word template and use automation to open Word, create a
document from the template, and place the information in the bookmarks
or formfields.

These links should help:
Albert Kallal's simple mailmerge application:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

ACC: Sending the Current Record to Word with Automation
http://support.microsoft.com/?id=131583 (Word 97)
http://support.microsoft.com/?id=209976 (Word 2000)

http://www.mvps.org/access/modules/mdl0043.htm
Opening a new Word document based on a template through Automation

Q209976 ACC2000: Using Automation to Run Word Mail Merge from Access
http://support.microsoft.com/?kbid=209976

http://word.mvps.org/faqs/interdev/GetDataFromDB.htm
 
Hello John, iv tryed sending a question bt unfortunately iv not een able 2 do
it formally, so i decided to ask my question by replying to your post.
im having problems exportig data from access to word. i want to export my
records in access to word, but when i do so, the grid lines and field titles
show up when i copy and paste which i do not want. i have records for book
referencing as shown below;
Rogers.C (2000) This is an Example, Nod Publishing U.S.A
the name, year, Book title, and publishers name are all in differnt fields
in my database.
my desire will be to get the details as it is in word.
im quite new to access and when i read through some questions, im wondering
if there is any way of automatically importing my database records from
access directly when working from a word doc.
 
Don't use copy and paste but one of several other techniques. A database
field may be the most appropriate (you can create one by displaying
Word's Database Toolbar and clicking the Insert Database button), or one
of the techniques described in my answer to the original question, whihc
I've pasted at the end of this message.

Hello John, iv tryed sending a question bt unfortunately iv not een able 2 do
it formally, so i decided to ask my question by replying to your post.
im having problems exportig data from access to word. i want to export my
records in access to word, but when i do so, the grid lines and field titles
show up when i copy and paste which i do not want. i have records for book
referencing as shown below;
Rogers.C (2000) This is an Example, Nod Publishing U.S.A
the name, year, Book title, and publishers name are all in differnt fields
in my database.
my desire will be to get the details as it is in word.
im quite new to access and when i read through some questions, im wondering
if there is any way of automatically importing my database records from
access directly when working from a word doc.

Original answer:
 
Hello John,
Im trying to see if there is a way to import my access records to word
without the field names. my idea is to use a shortcut key (or some other
degree of automation) to get individual records from an existing databse when
working in word. I have created a report in access with the inteded fields i
need from my database. i want to be able to view the report and also, import
the records individually so that all fields in each record are combined
together at the time of import (pls see the examplee below). Im thinking if
the possible use of delimiting properties(such as commas,dots) could be used
to enhance this; and how could it be done. my VBA knowlege is very weak at
the momment, but i intend to improve .

Example
LASTNAME INITIAL YEAR GENDER
White, C.K (1956). Male.
Green, B.W. (1970). Female.


(***This is what i want my output to look like when imported to a word
document as shown below***)

White, C.K. (1956). Male.
 
Here's one way.

1) In Access, use a form and not a report. Reports are designed for
reporting on the contents of a database; to interact with the contents
you need a form. Put a button on the form; set its Caption to
"CopyRecord" (or use a clipboard icon) and its name to "cmdCopyRecord"

2) find the clipboard functions code at
http://www.mvps.org/access/api/api0049.htm and paste it into a new
module in your database.

2) In the Click event procedure of cmdCopyRecord, put something like
this. The details depend on the names you have used for the controls on
the form. I've assumed that the LastName field is displayed in a textbox
named txtLastName and so on.

Dim strRecord As String

strRecord = Me.txtLastName & ", " & Me.txtInitial & " (" _
& Me.txtYear & "). " & Me.txtGender

Clipboard_SetText strRecord

This will put the data in the record onto the clipboard in the form you
want; from there you can paste it into Word.
 
Back
Top