Results 1 to 5 of 5

Thread: Why does this code not work?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Posts
    14

    Why does this code not work?

    Im trying to make a program which converts .doc files into .html.

    i have this code but i get a "Compile Error user-defined type not found" error.

    Im sure this is a trivial error but i am new to vb and ive been put in the deep end to make this program

    My code looks like this:

    private Sub Command2_Click()

    ' This procedure steps through the FileConverters collection
    ' looking for the HTML converter, and then converts the current file.

    Dim wrdConverter As FileConverter
    Dim strMessage As String
    Dim strPath As String

    'Get a name and location for the converted file.
    strMessage = "I:\temp\Birds Profiles\pigeon.doc"
    strPath = InputBox(strMessage)

    For Each wrdConverter In Word.FileConverters
    'If found, Save As, then exit the loop.
    If wrdConverter.ClassName = "HTML" Then
    ActiveDocument.SaveAs _
    FileName:=strPath, _
    FileFormat:=wrdConverter.SaveFormat
    Exit For
    End If
    Next wrdConverter
    End Sub



    Can someone give me and idea where i could be going wrong here?

    Also once it works for 1 file (in this case pigeon.doc) I would like to make it so u can select more than one file simultaneously and convert them all. If any ideas please feel free to post them.

    Once again these queries might be trivial for you guys but go easy on the newbie thanx in advance.
    Last edited by EndoKrine; Feb 3rd, 2003 at 07:57 PM.

  2. #2

  3. #3
    Member
    Join Date
    Jan 2003
    Posts
    43
    ummm one of the top lines is typed rivate Sub. .. so on you might wanna change that to Private Sub... LOL
    Life sucks and then you die.
    So before you die absorb some VB!

  4. #4
    Member
    Join Date
    Jan 2003
    Posts
    43
    Did u like just change that to Private??? cause im possitive that before it was rivate... am i goin crazy?
    Life sucks and then you die.
    So before you die absorb some VB!

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Posts
    14
    lol yeh ur totally sane mate - i did change it.

    Ok thanx for your help guys - worked it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width