Copy data from form or report to be pasted in word document (1 Viewer)

jpl458

Well-known member
Local time
Today, 01:36
Joined
Mar 30, 2012
Messages
1,038
I have the need to be able to copy data from a form or report and put into a Word document. The copy would contain both dat and preset text and look something like this:

1, Data preset txt data
2, Data preset txt data
3, Data preset txt data
etc.

The data would come from a query. It's creating a list that I need to copy and paste into a Word doc, and Mail merge doesn't fill the bill here. I've tried both reports and forms and the copy part just doesn't work the way I need. Is this possible?

Thanks
 
Last edited:

ebs17

Well-known member
Local time
Today, 10:36
Joined
Feb 7, 2020
Messages
1,946
The data would come from a query.
A query is great.

=> From this you can use ADODB_Recordset.Getstring to create a complete string and insert it into a Word document.

=> If you prefer a table in the Word document for the display, you can use the Word method ConvertToTable from the recordset to create a table from the query and insert it into the Word document.

Is this possible?
I would say yes.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 04:36
Joined
May 21, 2018
Messages
8,529
If you can post a sample DB and a Sample word document that would help. Only need to post the minimum. The word can be generic to show where and what sections to put the data. You can replace most text with random words if needed. The db needs the query fields you want to paste. The info could be random.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:36
Joined
Feb 19, 2002
Messages
43,275
See if this sample helps you. It uses OLE automation to fill bookmarks in the Word document. This is for example only. There are better methods if you need to fill many different types of Word documents.

 

Users who are viewing this thread

Top Bottom