|
-
Feb 3rd, 2003, 07:46 PM
#1
Thread Starter
New Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|