User defined type not defined error. Please help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ConfusedMay
    New Member
    • Apr 2007
    • 57

    User defined type not defined error. Please help

    Hi

    I have an error message in access 97 database and I was hoping that someone can help me with this (i've been searching the answer but seems like I couldn't find the right answer). When I clicked the open word document button on one of the form, I got "User defined type not defined" error message. Here is the code that connected to the button

    Code:
    Private Sub openWordButton_Click() <------ highlighted in yellow
                Dim objWord As Word.Application <------ highlighted in yellow
             Set objWord = CreateObject("Word.Application")
             With objWord
                ' Make the application visible.
                .Visible = True
                ' Open the document.
                .Documents.Open ("i:\sales.doc")
    I went to the references properties on the menu bar and this is the list which are selected:
    visual basic for applications, microsoft access 8.0 object library, microsoft DAO 3.6 object library. could someone help me please? Thank you so much in advance.
    Last edited by NeoPa; May 26 '07, 07:30 PM. Reason: Tags
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by ConfusedMay
    Hi

    I have an error message in access 97 database and I was hoping that someone can help me with this (i've been searching the answer but seems like I couldn't find the right answer). When I clicked the open word document button on one of the form, I got "User defined type not defined" error message. Here is the code that connected to the button

    Private Sub openWordButton_ Click() <------ highlighted in yellow
    Dim objWord As Word.Applicatio n <------ highlighted in yellow
    Set objWord = CreateObject("W ord.Application ")
    With objWord
    ' Make the application visible.
    .Visible = True
    ' Open the document.
    .Documents.Open ("i:\sales.doc" )

    I went to the references properties on the menu bar and this is the list which are selected:
    visual basic for applications, microsoft access 8.0 object library, microsoft DAO 3.6 object library. could someone help me please? Thank you so much in advance.
    Do you have a reference to the MS Word 8.0 object library?

    Comment

    • ConfusedMay
      New Member
      • Apr 2007
      • 57

      #3
      Originally posted by puppydogbuddy
      Do you have a reference to the MS Word 8.0 object library?
      No I don't, but I do have MS Word 9.0 object library and when I checked it, the user defined error disappearred, now I get new error message saying missing DLL file.

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        Originally posted by ConfusedMay
        No I don't, but I do have MS Word 9.0 object library and when I checked it, the user defined error disappearred, now I get new error message saying missing DLL file.
        That probably means you need to register Word internally with windows. This is usually a simple process if done as shown below:

        Open two Windows Explorer windows - one window displaying the .dll and the other Regsvr32.exe. Now drag the .dll over the Regsvr32.exe and presto the .dll is registered

        Comment

        • ConfusedMay
          New Member
          • Apr 2007
          • 57

          #5
          Originally posted by puppydogbuddy
          That probably means you need to register Word internally with windows. This is usually a simple process if done as shown below:

          [color=black][font='Times New Roman']Open two Windows Explorer windows - one window displaying the .dll and the other Regsvr32.exe. Now drag the .dll over the Regsvr32.exe and presto the .dll is registered[/font][/color]
          thank you so much for the reply, but could you please help me on how to display the .dll file? is it all the .dll files? would you mind tell me the step by step? Sorry for the inconvenience.

          Comment

          • puppydogbuddy
            Recognized Expert Top Contributor
            • May 2007
            • 1923

            #6
            Originally posted by ConfusedMay
            thank you so much for the reply, but could you please help me on how to display the .dll file? is it all the .dll files? would you mind tell me the step by step? Sorry for the inconvenience.

            Sure. no problem.
            1. These are the two files you need:
              MSWORD9.OLB Located in the MS Office Directory
              REGSVR32.DLL generally located in Windows/System32 Directory
            2. Because they are in two different directories, in order to work with them at the same time, you have to bring them up in two different windows.
            3. Once you brought each file up in its own window, then all you have to do is mouse click on the word file (MSWord9.OLB) and drag it over the .dll file. As soon as you release the mouse again, you should get a message that the word file has been registered.
            Last edited by NeoPa; May 26 '07, 07:33 PM. Reason: Illustrate use of List tags

            Comment

            • puppydogbuddy
              Recognized Expert Top Contributor
              • May 2007
              • 1923

              #7
              oops! wrong file extensions: Regsvr32.exe and should be an MSWORD9.DLL

              Comment

              • ConfusedMay
                New Member
                • Apr 2007
                • 57

                #8
                Originally posted by puppydogbuddy
                oops! wrong file extensions: Regsvr32.exe and should be an MSWORD9.DLL

                Thank you so much.. I'll start working on it.

                Comment

                • puppydogbuddy
                  Recognized Expert Top Contributor
                  • May 2007
                  • 1923

                  #9
                  Originally posted by ConfusedMay
                  Thank you so much.. I'll start working on it.
                  sorry wrong file extensions again:

                  it should be drag MSWord9.OLB over the Regsvr32.exe

                  Comment

                  Working...