Application Dim wordDoc As Word. Application With wordApp. I read about an object library reference, but did not understand what I was looking for. I know it is looking for an end statement, but not certain , exactly what. Could you take a little time to explain, what it is looking for? If the error occurs at the first line of the procedure you need to add the reference Microsoft Word xx.
I played around with the code, and now it opens word, but not the document. I first thought the issue was with the Z drive location, so I Placed a copy of the entire folder on the C drive. Now it opens word, but not the document. Here is the code: Option Compare Database.
With wordApp. If you need to use wordDoc in your code you can try: With wordApp. A little help, please. Remove the space between p and orting if the doc file name contains a space.
Just make sure the file is there with the correct name. But on my task bar it shows word open. When I click on the icon, word is open, but no document. I tried it. I did open word, without the error message, but not the document.
Use VBA. If you do, use VBA. Better, not quite there. Either one, opens word with any error message. Worked just fine. Outside access, manually use explorer to find the file and double click. Does it open? At the top of the window under the document title is the entire path. No more problems. It sounds like the problem is with the word document you are trying to open. Fix the problems you are having with your word documents.
No Account? Sign up. By signing in, you agree to our Terms of Use and Privacy Policy. Already have an account? Sign in. By signing up, you agree to our Terms of Use and Privacy Policy. Enter the email address associated with your account. We'll send a magic link to your inbox. Email Address. I'm using Access and created a help button on a form that I would like to open up a Word doc with instructions.
Here's the code I tried:. The problem is, when I try to compile I get an error on the first line that says "User-defined type not defined". Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 5 months ago. Active 2 years, 8 months ago. Viewed 35k times. Application Dim wrdDoc As Word.
Application" wrdApp. Open filepath End Sub The problem is, when I try to compile I get an error on the first line that says "User-defined type not defined". Improve this question. Kazimierz Jawor I didn't. I'm new to VBA, how would I do that?
X Object library with the highest possible number after in XX. X possibly Then run the macro again The only answer I can accept is the one below by fabio.
Since you commented I can't accept those. Add a comment.
0コメント