Mystery compile error "User-defined type not defined" at DataObject

Anonymous
2018-02-09T18:37:58+00:00

I am using simple code in Word 2016 and getting the error pointing to the statement below

     Dim MyData As DataObject

Installed references are Microsoft Active X Data Objects 6.1 Library, Microsoft Office 16.0 Object Library, Microsoft Word 16.0 Object Library and Microsoft Data Access Components Installed Version

Can anyone suggest what I am missing?

Thanks much!

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
{count} votes

5 answers

Sort by: Most helpful
  1. Vijay A. Verma 104.7K Reputation points Volunteer Moderator
    2018-02-09T19:00:53+00:00

    Do following. Should work for you.

    Open References in Word VBA

    Click on Browse

    Pick up this file and click Open

    C:\WINDOWS\SYSTEM\FM20.DLL

    Not it will add Forms 2.0 library. This should work now.

    Let me know if above doesn't work.

    30 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-02-10T21:56:18+00:00

    Yup, that worked! Found it in C:\Windows\SysWOW64\FM20.DLL

    Thanks much!

    8 people found this answer helpful.
    0 comments No comments
  3. Vijay A. Verma 104.7K Reputation points Volunteer Moderator
    2018-02-11T02:14:29+00:00

    Great! I am glad that worked! If you don't have any more questions, feel free to choose a rating and have a great day!

    0 comments No comments
  4. Anonymous
    2018-06-13T07:28:06+00:00

    Had the same issue (debug error “User-defined type not defined” at Dim doLink As DataObject) with this http://www.ourhints.com/vba/how-to-paste-lotus-notes-link-into-outlook-email/ script in Outlook 2016 and found the file located under c:\Windows\SysWOW64\FM20.DLL being the solution for that two.

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2018-06-13T07:30:25+00:00

    Had the same issue (debug error “User-defined type not defined” at Dim doLink As DataObject) with this http://www.ourhints.com/vba/how-to-paste-lotus-notes-link-into-outlook-email/ script in Outlook 2016 and found the file located under c:\Windows\SysWOW64\FM20.DLL being the solution for that two.

    26 people found this answer helpful.
    0 comments No comments