Access 2007 finding Word 2003
Being so secretive with code, it's hard to say, but I can successfully open a 97/2003 format file from Access 2007 through Shell with both Word 2003 and 2007. Same with Excel. Just by changing the path to Office directory (using correct path).
I have no chance testing late binding from Access 2007 to earlier versions of word or excel, but late binding does work here.
I don't have the runtime.
Conclusion:
There might be something wrong with your code, Office installation or the Access runtime. Good luck.
--------------------------------------------------------------
Hi Roy,
Many thanks, once more, for your response.
In fact, the only way I had been able to overcome this challenge IS, as you also suggest, by specifying the precise path to the OFFICE11 directory. My main challenge was that my users don't all have MSO.2003; some of them have MSO.2000 and some have MSO.2007.
My solution was to build-in to the utility a runtime method for switching the path between the following 3 targets when using the Shell method:
"C:\Program Files\Microsoft Office\OFFICE\"
"C:\Program Files\Microsoft Office\OFFICE11\"
"C:\Program Files\Microsoft Office\OFFICE12\"
The code I used was:
---- CODE STARTS ----
Dim stAppName As String
Dim MSOCode As Integer
'
stAppName = "Winword.exe c:\foldername\" & "filename"
'
If MSOCode = 0 Then
Call Shell("C:\Program Files\Microsoft Office\OFFICE\" & stAppName, 1)
ElseIf MSOCode = 3 Then
Call Shell("C:\Program Files\Microsoft Office\OFFICE11\" & stAppName, 1)
ElseIf MSOCode = 7 Then
Call Shell("C:\Program Files\Microsoft Office\OFFICE12\" & stAppName, 1)
Else
Call Shell(stAppName, 1)
End If
---- CODE ENDS ----
Although this solution is more cumbersome than I had hoped, it seems to work without problem.
One concern I have is that it might not be safe to assume that ALL my users will have the same installation paths as I have assumed, although why they might want to change the default path would be a mystery to me. Do you think I am safe to make this assumption, or should I include a navigation dialogue that enables the user to go hunting for the correct directory? I'm always apprehensive when the user has to do any more than turn on the computer and make the coffee.