Passing variables to a Word Doc.

I am trying for the 1st time to pass Access variables to a Word document. I used this as a starting point http://support.microsoft.com/kb/260410 It seem fairly straight forward. I made a little db with one table - one record - and I am attempting to have it pass the data and open a Word document. Without success. Attached are files that show the works. My Access DB My instructions on how to with the marco code I am trying to use The Word document I am going to Screen shots of the failure

Sponsored Links:

Related Topics

Open OLE Word Doc (and GoTo Bookmark in Doc)
I have a small Word doc (43kb) embedded(?) (not linked) as a record in an OLE field. I have a button on a form (record source = table containing Word doc), when clicked I want to open the Word doc.

Question 1:
What is the button's "on click" vba code to open this word doc?

Question 2:
I'd like to jump to a predefined bookmark in this Word doc. Can vba code do this?


Macro to export to word?
I have an access table that has 2 columns. I need each line exported to a seperate word document. Column A and Column B (where A goes on top of word doc and B near the bottom of the word doc).

I will have about 2000 lines that need to go to seperate word doc


Password Protect Word Doc Through VBA
I have a word doc in the same folder as my access application. At the click of a button I want the access application to password protect my word doc without opening it (atleast not visible to the user)

Consider my word doc name as "MyWord.doc"
Password as "testPass


Passing Parameter from Excel TO Access
I have an Excel form that from one texbox will open a word doc. Once the word doc is opened, it runs a mail merge and asks for an input parameter from the access query it is based off of. My question is, How can I pass the value from the Excel form to the parameter window that will display once the word doc has opened?

I know I could re-write the query to accommodate to this, but this is a large scale project, I would have to re-write probably over 1,000 queries, and I don't want to have to do that. And the same situation with, I know I can use Excel to run the SQL behind the query, which that might be a viable option, but would like to steer away from it at this current time since the actual SQL varies depending on certian criteria it is never 100% the same


Generating a Word Document
Is there any way to turn an access report into a word doc.

I can do a .rtf, but I lose graphical images, such as logos.

I can do a pdf, but then I can't edit it.

I tried a snp file, and that doesnt seem editable in word either.

I was trying to generate a text file, and use this to mail merge into a standard word doc - but that seemed a bit fiddly.

I don't really want to try and open and then edit a word doc from within access.

So, I just wondered if there was an easy? VBA method


Merge multiple Word-documents into one using Access
How can I best go about merging existing Word-documents into one, from within Access?

A list of Word-documents exists in the DB, and I need to create one Word-file.

This file contains the List of contents, based on which documents were selected by the user, some other db-generated data, and of course the documents themselves.

The question is about the generalt tactic (the programming mines/explosions I will get to when I have an idea as to how to procede : should I in Access create a new Word-doc object, add my db-generated data, and then the contents of each Word-doc on the list? Should I just create the Word-doc with db-generated data only, and somehow programmatically append the other relevant files? Or just dump a Report to a Word doc, and then append the rest?

Any suggestions? Just a few thoughts on the sensible approach would be nice, the coding part I think I can deal with


maro to open word doc
Can someone help me with a macro? I have only been working on access databases for a couple of weeks now but learning fast. I would like to use a macro to open a word doc. I can open the doc with the following code( Application.FollowHyperlink "C:\Template.doc") . I need to do this with a macro so that I can link this event to a button click that also does a make table query.


Scaling Word OLE object in Access Report
I have a complex report that, for each header record, must print a highly formatted word doc, then is followed with many subreports generated from my db.

The header record word doc is variable in size, ranging from a few paragraphs, to multiple pages.

I can link or embed the appropriate Word Doc to each of my header records as an OLE field on the header record. But when I embed the OLE field on my MS Access Report, The report control does not "scale" to show the Word doc in its original size, length, etc.

Instead, the entire doc content "sclaes down" to the fixed control size that I have drawn on myreport.


run macro on word doc closing
Is it possible to run a macro in access 2010 on close event of a word doc. I want to run an update query when I have sent some email. I want to first make sure I send the emails and the when I have finished close the word doc and then open query [QueryName].


close word > setfocus max access
When connecting to a word file using odbc, the word message "opening this document will run .sql" is hidden from the user. Is there a way to have the messagebox from word popup over access? So far the only way I have been able to view the message is to minimize access - I can do this with code. After the word doc merges to a new doc and is closed, how can I setfocus to access and maximize it again


Open word file off Access form
I have fairly large Access 2003 tables and forms on my job. I am curious if I can open word document off the form by using command button. Very often I need to put info off the form to word and sent it via e-mail to clients so I every time I have to keep a lot open word documents at the same time on my computer 10 or more that is slow pc down.

I would like to have like this : on specific form I have command button and when I need to work with word document , click that button that will open specific word doc and when I am done I think I need a secondcommand button to safe and close word document and so that I can attach it to e-mail and sent it out.

So every time I need to work with word doc, I can open it off the form and close it also when I am done with it so no word doc would be open unnecessarily.


wor document disappears
I have 2 end users that have a database created in access. When ever they open a word document that has be imported into the database and copy a line from the word doc, when they close the word doc it disappears from the database. Weird is it doesnt do this everytiime.


Batch import
I have a project that I am working on that is taking information off of a word doc (which I do by converting to txt and importing)

My supervisor, who knows I don't know crap about VB says that doing each doc is too much work and wants to batch the doc in the morning when he gets in.

Is there any way to write a program that will take all the doc files in a folder and convert them to txt files and then import them into a database


Module for searching multiple .doc files on multiple terms?
Info on system setup:

So I have an Access 2003 DB that is being used for career opportunities. This database sits behind my website where people can go to submit applications and upload their resumes in word.doc format. Every time a resume is upload it is place on a network drive that has a folder named "Resumes". This folder contains about 8500 files.

My question.

Is there any sort of method that can be used to do a search on all of these word.doc's using multiple criteria? I know that you can do a simple search using Windows that would be "one word or phrase in the file", but I would like to use more than just one word or phrase to go through every document and return some result


Open word doc from vba strips doc of merge-ability
First post. Thanks in advance for any help you can provide.

In my Access app (Access 2003), I'm trying to add a command button that launches a specific Word document. Following is my code, which works fine:

Dim LWordDoc As String
Dim oApp As Object

'Path to the word document
LWordDoc = "my_path\my_doc.doc"

Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True

'Open the Document
oApp.Documents.Open FileName:=LWordDoc

End Sub

When I press the command button the document launches as it should. However, this Word doc is a merge document, which draws data from a query that happens to be connected to this same Access app. When the Word doc launches I'm no longer presented with the "approve SQL data" dialog box. Instead, it just opens. The merge fields are still on the document, but it seems the connection to the query is no longer in place


Module for searching multiple .doc files on multiple terms?
UtterAccess Member
Posts: 6

Info on system setup:

So I have an Access 2003 DB that is being used for career opportunities. This database sits behind my website where people can go to submit applications and upload their resumes in word.doc format. Every time a resume is upload it is place on a network drive that has a folder named "Resumes". This folder contains about 8500 files.

My question.

Is there any sort of method that can be used to do a search on all of these word.doc's using multiple criteria? I know that you can do a simple search using Windows that would be "one word or phrase in the file", but I would like to use more than just one word or phrase to go through every document and return some result


Mail Merge from Access Form To Word Doc
I need to find a way to create a one click button that will select the current record from an access 2007 form and mail merge it with a predefined word 2007 document.From looking around online, I can tell you that I cannot use bookmarks or anything of that sort. It has to be mail merge-able due to the fact that that is how all of our word doc's are already set up. I can't copy it to a word table or excel sheet because we constantly have people in our DB adding to it.


Copying Access Form to a Word Doc
I created my first access form today. I would like to send it to my friends as a word doc (or maybe even as the text of an email) so that they can fill out the form and send it back to me. Is there a way to do that


Date formate prob
One of my tables are link to a form which the user is allowed to input a date by hand or using the calendar function, the formate seems fine at this point.

The data then is used to merg into a word doc after a query has got the information needed, but when it goes into the doc the formatting changes to USA, as you will understand you cannot change the formate within word as it kills the merg field.


Date formate prob
One of my tables are link to a form which the user is allowed to input a date by hand or using the calendar function, the formate seems fine at this point.

The data then is used to merg into a word doc after a query has got all the information needed, but when it goes into the doc the formatting changes to USA, as you will understand you can not change the formate within word as it kills the merg field.

I am sure it is a simply fix but