Sending Word bookmarks to Access

A

A_Classic_Man

I have built an Access(97) database which was converted to 2003 and an
Access form to send out assignments. The form has VBA code to send the
information to Word(2003) bookmarks. The Word document is actually a
template that is stored on the same server drive as the Access
database. The document is emailed to individuals who then fill in and/
or change bookmark data and email it back.(Some of the individuals are
still using Word 97) The document has VBA code so when a command
button is clicked, the data in the bookmarks goes into an Access 2003
table. I can get everything to work just fine when I create the
document and then send the information back to the database without
emailing the document.

The problem is that when I email the document and then the document is
emailed back to me, the VBA code is missing so the data cannot be put
in the database. Macros on the Word document are also gone.

The code was written on a computer with MS Office 97.
References are: Visual Basic For Applications, MS Word 11.0 Object
Library, MS Forms 2.0 Object Library, MS Office 11.0 Object Library,
OLE Automation, MS Access 11.0 Object Library, and DAO 3.6 Object
Library.

What do I do to keep everything in place?

Help is appreciated

Ron
 
D

Doug Robbins - Word MVP

You do not need to keep everything intact.

See the following page of fellow MVP Greg Maxey's website

http://gregmaxey.mvps.org/Extract_Form_Data.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

A_Classic_Man

You do not need to keep everything intact.

See the following page of fellow MVP Greg Maxey's website

http://gregmaxey.mvps.org/Extract_Form_Data.htm

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP











- Show quoted text -

Doug

Thanks for the quick response. I will give this a try.

Ron
 
A

A_Classic_Man

Doug

Thanks for the quick response. I will give this a try.

Ron- Hide quoted text -

- Show quoted text -

Doug

Does the code on the Word form or is it possible to place the code
behind a command button on an Access form. I guess I'm a little
confused about where the code is to work from.
The code I am now using is on the Word form and I am having trouble
losing the code when the form is emailed. I am working through a
server network and sometimes the Macros are gone when the form comes
back to me.

Thanks for the help

Ron
 
D

Doug Robbins - Word MVP

The code does not go in the forms. It goes into an add-in, which is a
template that you save in the Word Startup folder.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Doug

Thanks for the quick response. I will give this a try.

Ron- Hide quoted text -

- Show quoted text -

Doug

Does the code on the Word form or is it possible to place the code
behind a command button on an Access form. I guess I'm a little
confused about where the code is to work from.
The code I am now using is on the Word form and I am having trouble
losing the code when the form is emailed. I am working through a
server network and sometimes the Macros are gone when the form comes
back to me.

Thanks for the help

Ron
 
A

A_Classic_Man

The code does not go in the forms.  It goes into an add-in, which is a
template that you save in the Word Startup folder.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP






Doug

Does the code on the Word form or is it possible to place the code
behind a command button on an Access form. I guess I'm a little
confused about where the code is to work from.
The code I am now using is on the Word form and I am having trouble
losing the code when the form is emailed. I am working through a
server network and sometimes the Macros are gone when the form comes
back to me.

Thanks for the help

Ron- Hide quoted text -

- Show quoted text -

Doug

I finally had time to put the code to work and It's working great.

I would like to add a field to the Access database that contains a
combination of several bookmarks. Is it possible to add it to this
code.
Using the example from Greg Maxey's code, Name, Favorite Food, and
Favorite Color the database field would populate with RonSteakBlue.

The purpose is to combine a date, ID number, and time to use in a
field that is a primary key field in the Access table. How do I do
this?

Thanks

Ron
 
D

Doug Robbins - Word MVP

Combine the .Results of the formfields into a String that results in what
you want posted

Dim EntryforNewField as String

'other code

With myDoc
EntryforNewField = "On " & .Formfields("Date").Result & " the file
with ID Number " & .FormFields("ID").Result & _
" was processed at " & .FormFields("Time").Result & "."
vRecordSet("NewField = EntryforNewField
' ..... Etc.
End With



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

The code does not go in the forms. It goes into an add-in, which is a
template that you save in the Word Startup folder.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP






Doug

Does the code on the Word form or is it possible to place the code
behind a command button on an Access form. I guess I'm a little
confused about where the code is to work from.
The code I am now using is on the Word form and I am having trouble
losing the code when the form is emailed. I am working through a
server network and sometimes the Macros are gone when the form comes
back to me.

Thanks for the help

Ron- Hide quoted text -

- Show quoted text -

Doug

I finally had time to put the code to work and It's working great.

I would like to add a field to the Access database that contains a
combination of several bookmarks. Is it possible to add it to this
code.
Using the example from Greg Maxey's code, Name, Favorite Food, and
Favorite Color the database field would populate with RonSteakBlue.

The purpose is to combine a date, ID number, and time to use in a
field that is a primary key field in the Access table. How do I do
this?

Thanks

Ron
 
A

A_Classic_Man

Combine the .Results of the formfields into a String that results in what
you want posted

Dim EntryforNewField as String

'other code

    With myDoc
        EntryforNewField = "On " & .Formfields("Date").Result &" the file
with ID Number " & .FormFields("ID").Result & _
        " was processed at " & .FormFields("Time").Result & "."
        vRecordSet("NewField = EntryforNewField
'        ..... Etc.
    End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP











Doug

I finally had time to put the code to work and It's working great.

I would like to add a field to the Access database that contains a
combination of several bookmarks. Is it possible to add it to this
code.
Using the example from Greg Maxey's code, Name, Favorite Food, and
Favorite Color the database field would populate with RonSteakBlue.

The purpose is to combine a date, ID number, and time to use in a
field that is a primary key field in the Access table. How do I do
this?

Thanks

Ron- Hide quoted text -

- Show quoted text -

Doug

Just wanted to let you know your help is appreciated. I was able to
get all of your suggested code to work

Thanks for the help

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top