Modules & VBA :: Extract Data From A Word Document

Aug 21, 2014

Not sure if this is possible but I am trying to extract data from a word document to set up a database.

Basically I am trying to capture data from completed forms, similar to the sample attached, the actual blank form is 20 pages long and once completed can be as many as 30 pages, or even more, although the format doesnt change (i.e. individidual cells will expand to fit the data in the cell).

I want to be able to scan through the completed forms and extract the data i.e. Full Study Title, Short Study Title, Study Type etc. into a database.

The issues:
1. Each document will have a different name but will be stored in the same location.
2. What is on page 8, for example, in one document is not necessarity going to be the same on every document (due to expanding cells)
3. Each sector is in a separate table but tables can spread across several pages.
4. Some data is stored in a checkbox format rather than text.
5. I dont want to extract all of the data, only certain sections (at least at this stage).

View Replies


ADVERTISEMENT

Modules & VBA :: Get Data From Microsoft Word Document And Paste It Into Form

Jun 14, 2014

copying all the contents/text from word document and pasted that in the Memo Field, I have a Recruitment database where I have 02 fields on is CV Path (Text Field) that stores the CV Path (Word Document Path) and another text box content (Memo Field) where I would like to copy all the data from the word document to the Content text box (Memo) field.

I have put a Command button on the form...the code to "Copy the content/text" from [CV Path] word document and add it to the "Memo" field.

View 1 Replies View Related

Modules & VBA :: How To Update Data For A Chart Graph In Word Document From Access

Jul 29, 2013

Is it possible to update the data for a chart graph in a word document from Access using VBA?

View 4 Replies View Related

Extract Data From Word Doc

Mar 11, 2008

I have a word doc from which I want to import data in a Database.
The word doc has a table, something like this :

Projectnumber 10700004
LSname LSTK number one
POnumber 1170-LST-04
Contactname Mr. Karel van Straten
Vendorname Mothercompany name S.A.
Manufacturer Operating Company name
Otherdata Others
Mancity 46100 Hamburg
Mancountry Germany
Manorder 31-0111-009
Mancontact Mrs. Angela Duval
Mantel 0049 2323 209 151
Manmail email@testing.de

At this stage I copy the table data and paste it into a memo field in a Dbase Query and try to manipulate the text in that query to get some of the data segregated , i.e Projectnumber : 10700004 , Mancountry : Germany , etc.
However, this doesn’t work as I want.

e.g. I’m trying to get the Manmail text thru this qry :
Manmail: Mid([Memofield],Len([Memofield])-InStr([Memofield]," ")) , but the output is not consistent.

Would there be a better way to get the original ( doc-table) data in the same way in my database.

Note :
I could use an additional step : copy/paste to Excel and then import to Access, but that’s something I would like to avoid.

Any suggestion will be appreciated.

Cheers, Ron

View 4 Replies View Related

Modules & VBA :: Word Active Document Not Getting Recognized

Dec 26, 2014

I use the following code to achieve following

a) Open a word document from MS access / VBA,
b) Connect to data from a query
c) mailmerge it
d) Save it as a new document containing mailemerged letters.

The code does open the required document as I can see it open.

I put a message box to recheck that filename/path is what I mean, and to to know till which line the code runs. Code runs till that point and that word doc is seen open. I get the error message before

Then I get error message.

I was fooling around and was getting message " This command is not available because no document is open" I tried to remove few lines thinking redundancy. Before getting the message, I was also getting the error trapping message "No documents opened."

Now I am getting different message.

I am getting message " The remote Server Machine does not Exist or is unavailable"

Following is the code I have written.

Dim xlApp As Object
Set xlApp = CreateObject("word.Application")

xlApp.Visible = True
fn = FormPathName("941 2014 AutoOpen.doc")

[Code] .....

View 5 Replies View Related

Modules & VBA :: Image In Output To Word Document

Jul 18, 2015

We need to replicate an Access report we have in Microsoft Word. The report has a fixed, small image in the header and so we embedded it in the report (it is not in an external file). To put this image in the Word document the only way we have come up with is shown in the code below.

Code:
Dim apWord As Word.Application
Dim doc As Word.Document
Set apWord = CreateObject("Word.application")
doc.Shapes.AddPicture "G:ImagesSinful Banner.bmp", False, True, 0, 0, 540, 42

Which requires an external image file. We really would like to avoid this. We could make a template Word document, but that too would be an external file. We know how to put this image in a table as an OLE object, but can't find any way to get it from the table into the Word document.

View 12 Replies View Related

Modules & VBA :: Background Image In Word Document

Mar 18, 2015

If I use the word template named "ABC.dot" as attached and write the following piece of code to print off the letters with different appropriate background , it works perfectly fine:

Code:
Sub PrintLetters()
Application.DisplayAlerts = False
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim r As Long
Set cn = New ADODB.Connection

[Code] ....

But if I combine two templates together in one template as attached "Capita.dot" then it doesn't display background picture at all in any of the cases. I am using the same piece of code but the background image is not displaying. The background image shows logos for each letter like For capita letters , the logo will be capita . For Friends Life letters the logo background will be different.

View 1 Replies View Related

Modules & VBA :: How To Send Embedded Word Document As Email

Dec 17, 2013

I'm using ACCESS 2010. I have a form which is having a embedded word document. What I'm trying to do is i want to enable user to format a mail in the embedded word document which will contain rich text and screenshots then with a click of button an outlook mail should open and content of this document should be pasted there. Once user sends this email, I want to save content of embedded document in the database.

View 4 Replies View Related

Modules & VBA :: Search To Open Word Document From Access

Oct 27, 2014

I was tasked to create an application where by the user enters keywords into an Access form, and when he clicks the button, it will run the keywords against the file names stored in the table and automatically open the Word document that is the best match.

I have created a table query called Directory, which contains FPath (Z:), FName (Document1.doc) and Directory (Z:Document1.doc).

Code:
Private Sub Command2_Click()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim filepath As String
Dim strSearch As String

If IsNull(Me.txtSearch) Or Me.txtSearch = "" Then
MsgBox "Please type in your search keyword.", vbOKOnly, "Keyword Needed"

[Code] ....

This is the code that I am currently using to search and open the Word documents, however, this code only manages to open Microsoft Word program without loading any documents. Also, there are no error messages when I click the submit button.

View 3 Replies View Related

Modules & VBA :: Display Watermark On Second Page Of Word Document

Mar 19, 2015

There are two pages in a word document. All the pages have same headers as attached in word document "Capita.doc". I want to display that header on just first page and on second one page, I want to display watermark stored in "J:PAP107.jpg". The following code displays same watermark on all the pages i.e "J:PAP107.jpg" but I want to keep the header as in the attached word document on first page only and display watermark stored in "J:PAP107.jpg" on second page.

Code:

Private Sub CmdPrint_Click()
Call WordSetupQA("C:CAPITA.dot", "J:PAP107.jpg", Format(DateSerial(ComboBox4, ComboBox3, ComboBox2), "mm/dd/yyyy"), pno)
End Sub

Code:
Sub WordSetupQA(fnTemplate As String, fnBackGroundPic As String, b As Date, a As String)
On Error Resume Next
'MsgBox txtbox
Application.DisplayAlerts = False
Dim strworkbookname As String
strworkbookname = "C:System1.mdb"
Set WordApp = GetObject(, "Word.Application")

[code]....

View 1 Replies View Related

Modules & VBA :: Export Picture Attachment To Word Document

Dec 17, 2013

I am trying to export an attachment item (Picture .jpg) to a word document. I have been exporting text to a word document successfully with below syntax "

With rst
strLandSalesID = Nz(.Fields("LandSalesID"))
strPhotograph = Nz(.Fields("Attachments"))

However, attachment do not work.

View 3 Replies View Related

Modules & VBA :: Automating Mailmerge From Access Form To Word Document

Aug 5, 2013

I am having the strangest results with my automated mailmerge. Basically it does work, but not all the time. The basic idea is to allow the user to dynamically create a query that produces a result list which fills a temporary table. The use then selects a prebuilt merge template and merge is executed against the temp table. The merge template are of the .doc type, but sme have been converted to .docx; the .doc files tend to work most often, but all of the will eventually get a Table is locked message... However if I run in test mode with code breaks and manually step through the process it always works... here is the heart of the code ...

Err_Pos = 10

Code:
DoCmd.SetWarnings False
' if tmp tbl left over from last run kill it
DoCmd.RunSQL "Drop table Word_Merge_Tmp_TBL"
Err_Pos = 12

[Code].....

There are many error cases in the error catch routine. That I have managed to make Access stop hanging when word has a problem or the table is locked. But I can't get the table to be free consistantly and why does it always work when I manually step through the code.

View 4 Replies View Related

Modules & VBA :: Link / Export Query To Existing Word Document?

Apr 10, 2014

Like the title says it:

Is it possible to link/export a query to a existing Word document?

I have several Word documents with text, and i want to place the data of a few query's in those documents in a certain place.

Is this possible true vba or another way?

View 4 Replies View Related

Modules & VBA :: Attaching Word Document To Attachment Field For Every New Record

Jan 12, 2015

I'm trying to work out how to attach a word doc to the attachment field of a table when I add a new Record. The following code work's fine if I add it to the On Load Event on the Form, but the doc is attach'd to the first record. When I add the code to the Add New Record button, I get the error msg: "File already part of the Multi-Valued Field" and nothing in the attachment field.

Code:
Private Sub Add_Record_Click()
DoCmd.GoToRecord , , acNewRec
Me.Description.SetFocus
On Error GoTo Err_AddImage
Dim db As DAO.Database
Dim rsParent As DAO.Recordset2
Dim rsChild As DAO.Recordset2

[Code]...

View 8 Replies View Related

Modules & VBA :: Quick Way To Export ALL VBA Code To A Text File / Word Document?

Aug 4, 2014

Is there a quick way to export ALL VBA code to a text file/word document?

View 5 Replies View Related

General :: Open Word Document With Corresponding Data Filled From Text Field Of A Form

Jul 10, 2013

I am trying to open a word document with corresponding data filled from the text field of a form. I managed to get the word document but I don't know how to give a variable in word document.

View 2 Replies View Related

Modules & VBA :: Word Document Load When User Click Button And Perform Email Merge

Oct 7, 2013

I have a Word 2010 document linked to an Access 2010 data source. When a user clicks a button in Access, the Word document loads and performs a email merge using the below VBA code:

Private Sub Document_Open()
With ActiveDocument.MailMerge
.Destination = wdSendToEmail
.SuppressBlankLines = True

[Code] ....

However, as the .mailsubject part is not in the loop it is only retrieving the first Return Code. I have tried to integrate in the loop to no avail. Also, how do I add static text to the Subject, I need something like "Your Return Code" + "Return Code"..

View 6 Replies View Related

Modules & VBA :: Extract PDF Data To Table

Nov 21, 2013

Through searching, I have seen a lot of post regarding 3rd party downloads to extract pdf data to a table, any coding or a sample database that doesnt require 3rd software?

In the end, I want to import the pdf data to the table, then attach the pdf file automatically. URL....I have a pdf form that was developed in Adobe Live Cycle. For sake of example, lets say my form object names are:

TextField1
TextField2
DateField1
CheckBox1
CheckBox1[3]

View 13 Replies View Related

Importing A Word Document

Mar 30, 2005

Hello all,
In our company we send off a lot of reports for a given sample. Sometimes the office folks need to do a specialized report with tables and other formatting. They would like to be able to a: be able to have another report where they could just write stuff, comments, etc about the sample and b: be able to import these word documents that have the tables and other formatting. If we could not use word at all that would be great but I don't think there is a way to do the formatting necessary in access. So my question is: how do I import a word document and have it displayed in a form and then print on the report. I would like to store the whole document in one field in a table. (is this at all possible?) I have searched this forum and haven't found what I'm looking for. Thank you for any help.

Greg

View 1 Replies View Related

Generate Word Document

Jan 26, 2006

Hello all,

Is there a way that I could put a command button on my form and on clicking it, it would generate a word document (I have a word document saved) but on the word document, it would populate the address field with the information on the form. I have about 5 fields on the form that will be used in the word document.

I thought about creating a report in access instead, but I might want to edit the word document manually, is there a way to do this?

Thanks much.

View 5 Replies View Related

Snapshot To Word Document

Jul 18, 2006

I have the following button on a form:



When I press it a mail is being send with a snapshot attached to it



Instead of a snapshot I want it to attach it as a word document.

Here you see the code that is used. I noticed it says snapshot format on a line but I don't know what the name is for a word document.

Code:Private Sub cmdMail_Click()On Error GoTo Err_cmdMail_Click Dim stDocName As String Dim V_EmailAdres As String If Not (IsNull(Me.HauliersEMAIL.Value)) And Me.HauliersEMAIL.Value <> "" Then V_EmailAdres = Me.HauliersEMAIL.Value Else V_EmailAdres = "" End If stDocName = "TransportOrder" DoCmd.SendObject acReport, stDocName, "Snapshot Format", V_EmailAdres, , , "Transport Order BP", ""Exit_cmdMail_Click: Exit SubErr_cmdMail_Click: MsgBox Err.Description Resume Exit_cmdMail_Click End Sub

Thanks in advance

View 2 Replies View Related

Modules & VBA :: Extract Transaction Data From Quickbooks

Jun 26, 2015

I'm trying to extract invoice and payment transaction data from a very old version of quickbooks. This very old version allows for the export of customer and item lists to .iif format which I can view in Excel. However, there is no method of exporting transactions. All of my searches for how to extract the data have come up empty.

I am pretty sure that I once found a post relating to looping through the file line by line and converting the data using vba. I can't find that post anywhere either.

Any method of extracting data from a quickbook .qbw file. I'm willing to do a fair amount of manual parsing if I have to, but I need to get to the data first.

View 4 Replies View Related

Store Word Document In A Variable

May 10, 2005

hi,

Is there a way to store the text of a word document in a variable without opening the document?

I explain:
I have document1.doc opened
I want to copy and paste the contain of document2.doc at the end of document1.doc without opening document2.doc

I ve tried to use

Open "document2.doc" For Input As #1
Do While Not EOF(3)
Line Input #3, temp
tempstr = tempstr & temp
Loop
Close #3

but I don t get the result

Any idea?

View 2 Replies View Related

Opening A Word Document Within Access

Sep 14, 2006

I've used the Outputto method to archive reports creted in Access to Word in .rtf.

I now want to have an option to view these archives from Access. How?

Thanks,

Richard

View 2 Replies View Related

Populate A Word Document With A Button?

Sep 20, 2006

Sorry if this isn't the right place for this, but it didn't seem to fit in anywhere else.

I have a simple database, which pretty much now works as I want it to. The only element I really needs to get working is some way of producing - at the click of a button - a Microsoft Word document, elements of which are populated by fields on whichever record the database user happens to be viewing at the time.

I already have the exact layout and template of the Word document I want, but I need to be able to view any record then click one button to fill that template with the record's fields and print it, and another button to fill the template with the record's fields and save it (again, in .doc format).

Is this possible?

View 13 Replies View Related

How To Open A Word Document From Within Access

Jan 4, 2007

I am creating a database for someone which includes a mail merged document with some data from the database.
Is it possible to allow the user to open the document by clicking on a button that will be on the Switchboard in the database, so that they do not have manually open the document?
Hope this makes sense!

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved