General discussion

Locked

Create object in Word

By hurdk ·
I am copying a file from Word to Outlook

I need to create an object in Word to solve the error:

User-defined type not defined

caused by:

Dim oOutlookApp As New Outlook.Application

My code works on the toolbar but not in a command button in Word.

Thank you.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Create object in Word

by Peyison In reply to Create object in Word

Did my previous answer not work? Did you make sure you have a reference to the Outlook Library in the document that contains the command button? The problem is, without a reference to the Outlook library, Word doesn't know what "Outlook.Application"is, so it thinks it must be a user defined type. If you add the reference (as described in my answer to your previous question) it should work.

Hope this helps.

Collapse -

Create object in Word

by hurdk In reply to Create object in Word

This answer is totally correct.
The answer helped me.
I had a misconception that I had to create an object as well as check the Outlook Object Library.
I also was not attaining the Outlook Object Library from the form.
I use alt F11 tools references.

Collapse -

Create object in Word

by hurdk In reply to Create object in Word

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums