简体   繁体   中英

Opening word doc from VBA

I have a subroutine in MS Access that opens a specific word doc file. The gist of the code is

Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim filepath as String

'Open Word
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True

filepath = CurrentProject.Path & "\Prospect Profiles\Account Profile Form.doc"

'Open the file
Set wrdDoc = wrdApp.Documents.Open(filepath)

So here's the kicker - The subroutine works for all but one of our employees. We're all on the same Citrix environment, and we all have the same version of Access and Word. For this user, the subroutine does not give an error - it smiply opens a blank instance of ms word but it never opens the word doc file. What gives?

Aha! It turns out that this user had made a copy of an older version of our database front end and he wasn't accessing our current, updated version. Thanks for all the help y'all!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM