Open MS Word in Access 2007

K

KADL

Thanks, Gina. I'm anxiously waiting to see what your mission turns up.


Gina Whipp said:
I understand Access 2003 databse in Access 2007 but with Word 2007.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Just to clarify, we are running Access2007, but in compatability mode. We
are not converting the database to 2007.

Gina Whipp said:
I am going to run some tests... because now my thinking is Access 2003
and
Word 2007 don't play nice together and that is why nothing we are doing
is
working.

Not giving up... on a mission now :cool:
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Yes. The users all were upgraded to the Office 2007 suite this week.
They
run Word (and the other suite apps) locally and the path in the table
is
correct. The only thing different from last week is that the Office
suite
is
now in an Office12 folder instead of an Office11 folder for the 2003
suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


:

Is Word loaded locally for each User? Did you verify that that path
to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Darn! Users are still getting either a "Path Not Found" or a "File
Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation
Officers"
(which tells where the Word doc can be found). The data is an
intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\
etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She
also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired
Word
doc
manually.

Could Access 2007 running in compatibility mode be reading those
paths
differently than 2003 does? One has the \\path and the other has
the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

:

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a table
that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to
Word
is
set
and it's looking for WOrd in a specific folder. And since it's
not
in
this
bit of code it must be somewhere else. Do the machines at work
only
have
Office 2007? Do you see any modules under the module tab in
your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you
would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field
combo
box
appears for the user to select a word doc that they want to
use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I
pasted
the
important
called function. Note that there are commented out lines in
here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers",
"[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases
Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode
As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String,
Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form
ID]
=
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control
 
G

Gina Whipp

I am soo sorry it took so long to get back to you but I lost this post and
FINALLY found it! I have bad news... Access 2003 will not open Word 2007 as
far as I can tell. It is probably because the file format is different.
Just so we are clear...

Access 2003 format will open in Access 2007 format BUT Access 2007 format
will not open in Access 2003 format

so...

Access 2003 cannot open Access 2007 or Word 2007 because of the file format
difference.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Thanks, Gina. I'm anxiously waiting to see what your mission turns up.


Gina Whipp said:
I understand Access 2003 databse in Access 2007 but with Word 2007.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Just to clarify, we are running Access2007, but in compatability mode.
We
are not converting the database to 2007.

:

I am going to run some tests... because now my thinking is Access 2003
and
Word 2007 don't play nice together and that is why nothing we are
doing
is
working.

Not giving up... on a mission now :cool:
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Yes. The users all were upgraded to the Office 2007 suite this
week.
They
run Word (and the other suite apps) locally and the path in the
table
is
correct. The only thing different from last week is that the Office
suite
is
now in an Office12 folder instead of an Office11 folder for the 2003
suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


:

Is Word loaded locally for each User? Did you verify that that
path
to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Darn! Users are still getting either a "Path Not Found" or a
"File
Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation
Officers"
(which tells where the Word doc can be found). The data is an
intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program
files\
etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine.
She
also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the
command
button
does correctly create the merge file. They can open the desired
Word
doc
manually.

Could Access 2007 running in compatibility mode be reading those
paths
differently than 2003 does? One has the \\path and the other has
the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

:

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a
table
that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path
to
Word
is
set
and it's looking for WOrd in a specific folder. And since
it's
not
in
this
bit of code it must be somewhere else. Do the machines at
work
only
have
Office 2007? Do you see any modules under the module tab in
your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you
would
need
to
see. There are gosubs and user defined functions, so I
hope I
didn't
miss
anything. The first time the button is clicked, another
field
combo
box
appears for the user to select a word doc that they want to
use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I
pasted
the
important
called function. Note that there are commented out lines
in
here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers",
"[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant
Cases
Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String,
Pbo_DefaultPrinterMode
As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String,
Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table",
"[Form
ID]
=
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control
Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control
 

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