Link to home
Start Free TrialLog in
Avatar of nass1
nass1

asked on

convert Word 2000 Doc into a HTML file

How can I convert Word 2000 Doc into a HTML file via a ( free or cheep Component ) or a function like fileConverter ?

Also I need to convert Excel XLS files and Power point ?

I need an automated conversion, The file is uploaded to the server as .doc the
ASP script should convert it to HTML with images and table to make it viewable in the browser.

The best method will get 300 points and an A .
Avatar of sdm395
sdm395

Assuming that the server has got the necessary references on it, it might be an idea to use word's in built save to html feature, which seems to work OK in Word 2000.  Create a Word object and then load in the document, save it as html and start on the next one.....although I am sure that there are commercial converters out there to do this... let me know if you want code....
Avatar of nass1

ASKER

Ok can you give me some code ?

and will it work with Excel and Power Point?
if yes PLEASE how?
Selection.TypeText Text:="This is my web page."
    Selection.MoveLeft Unit:=wdCharacter, Count:=20, Extend:=wdExtend
    Selection.Font.Bold = wdToggle
    ActiveDocument.SaveAs FileName:="mypage.html", FileFormat:=102, _
        LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
        :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
        SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
        False

Go through and fix your other PAQ's and i'll tell you how to do it, that's a preview.
Avatar of nass1

ASKER

what is PAQs and how can I use your code??
You have asked 2 other questions on Experts Exchange that have not been responded to.  Other experts used their time to help and you have not awarded points to those questions.  Please respond to those questions (PAQ's) and I will be more than happy to assist you.
Avatar of nass1

ASKER

Can you PLEASE tell me what are those two Q. that I didn't give any point on?????

If some one is goin to reply with some OLD or info that is not within the subject then they should not be given POINTs, this is not a place to PASS point, If the answer is usefull then they will be GIVEN the points with an A.

For this Q. I need something that works with MS Word,Excel
ans Power Point. if the answer will only give me one then only 100 point will be given!


You want to make a web page from Excel AND powerpoint?????
Avatar of nass1

ASKER

No I have File in Word Excel and Power Point format I need to view them as HTML, I need to automate the convetion the file to HTML with images.
the word and excel files are uploaded to the server, An ASP script should convert them to HTML without lossing the Images So they can be viewed from the browser.
I'm using Office 2000 on the client and on the server.
Try this on.....I have done it in VB as a component, but you could happily put it in an ASP page with little work...

Dim x As Object
Dim y As Object
Dim strfilename As String

'Loop through file here
    'i.e. Do While
    strfilename = "H:\Charts1.doc"
   
    Select Case Right(strfilename, 3)
        Case "doc"
            'Do Word conversion
            Set x = CreateObject("Word.Application")
            Set y = x.Documents.Open(strfilename)
            y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", WdSaveFormat.wdFormatHTML
            y.Close
        Case "xls"
            Set x = CreateObject("Excel.Application")
            Set y = x.Workbooks.Open(strfilename)
            y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", xlHtml
            y.Close
        Case "ppt"
            Set x = CreateObject("PowerPoint.Application")
            Set y = x.Presentations.Open(strfilename)
            y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", ppSaveAsHTML
            y.Close
    End Select
    Set y = Nothing
    Set x = Nothing

'Loop

Let me know how you get on..
Avatar of nass1

ASKER

Error Type:
Microsoft Excel (0x800A03EC)
SaveAs method of Workbook class failed

  IT's in this line
y.SaveAs Left(strfilename,(Len(strfilename) - 3)) & "htm", xlHtml
Avatar of nass1

ASKER

can you show me where I can find the VB as a component Or download IT?
It could be that something in that workbook is hidden or protected....I'll try and find out.

Avatar of nass1

ASKER

Error Type:
Microsoft PowerPoint 2000 (0x80048240)
Presentations.Open : Invalid request. The PowerPoint Frame window does not exist.

In this line:
Set y = x.Presentations.Open(strfilename)

The Word works fine BUT Excel and Power Point ??????
Is there any setting I need to make in excel or IIS ?

I tested it on more then one file same Error!
PLEASE Help.
ASKER CERTIFIED SOLUTION
Avatar of sdm395
sdm395

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nass1

ASKER

Error Type:
Microsoft PowerPoint 2000 (0x80048240)
Application.Visible : Invalid request. Hiding the application window is not allowed.

In this line:
x.Visible = msoCTrue
Avatar of nass1

ASKER

I'm still getting an Error

Error Type:
Microsoft Excel (0x800A03EC)
SaveAs method of Workbook class failed

But sdm395  you where a Big help.

I will make an new question for this error I will give 100 points.



nass,

For excel version:

<%
On Error Resume Next

xlhtml = 44
Set Wrd = CreateObject("Excel.Application")
Wrd.Workbooks.Open (Server.MapPath("excel.xls")).Activate
wrd.Visible = False

wrd.Application.ActiveWorkbook.SaveAs Server.MapPath("xlhtml.html"), xlhtml

wrd.Application.quit
Set wrd = Nothing

IF Err.Number > 0 Then
     Err.Raise 6  ' Raise an overflow error.
     Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description
     Err.Clear    ' Clear the error.
End IF
%>

Regards,
Wee Siong
nass,

For powerpoint:

<%
On Error Resume Next

ppSaveAsHTML = 12
Set Wrd = CreateObject("PowerPoint.Application")
wrd.Visible = True
Wrd.Presentations.Open (Server.MapPath("power.ppt"))
wrd.ActivePresentation.SaveAs Server.MapPath("aa.html"), ppSaveAsHTML
wrd.quit
Set wrd = Nothing

IF Err.Number > 0 Then
     Err.Raise 6  ' Raise an overflow error.
     Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & VBCRLF & "<br>"
     Err.Clear    ' Clear the error.
End IF
%>

Regards,
Wee Siong