Share via

Compile Error: User-defined type not defined

Anonymous
2014-09-17T19:27:12+00:00

Hello! I'm getting an error in Microsoft Word 2010 VBA that ran fine until I uninstalled Access 2002 and installed Access Runtime 2010 - 'Compile error: User-defined type not defined'

And 'Dim nsMAPI As NameSpace' is highlighted and there are no missing references.

So I tried uninstalling Access Runtime 2010 and installed 2013 Microsoft Office 365, but no go, still doing the same thing when I try to compile my word document. So I've got Microsoft Office Home and Student 2010 and the whole suite of 2013 Office Products, including Word, Excel, Access and Outlook, but I've always used Windows Live Mail for my email. Here's the references that are checked:

Visual Basic for Applications,

Microsoft Word 15.0 Object Library,

OLE Automation,

Microsoft Forms 2.0 Object Library,

Normal,

Microsoft Office 15.0 Object Library,

Microsoft ActiveX Data Objects 2.0 Library and

Microsoft DAO 3.6 Object Library.

Help!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2014-09-17T21:45:38+00:00

You would need to create a Reference to the relevant version of the Outlook Object Library.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2014-09-18T13:52:18+00:00

    That did it! I added the reference to the Microsoft Outlook 15.0 Object Library, and it works fine.

    Thank you!

    Was this answer helpful?

    0 comments No comments