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 .
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 .
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....
ASKER
Ok can you give me some code ?
and will it work with Excel and Power Point?
if yes PLEASE how?
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:=F alse, SaveFormsData:=False, SaveAsAOCELetter:= _
False
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
SaveNativePictureFormat:=F
False
Go through and fix your other PAQ's and i'll tell you how to do it, that's a preview.
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.
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!
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?????
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.
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.Applica tion")
Set y = x.Documents.Open(strfilena me)
y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", WdSaveFormat.wdFormatHTML
y.Close
Case "xls"
Set x = CreateObject("Excel.Applic ation")
Set y = x.Workbooks.Open(strfilena me)
y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", xlHtml
y.Close
Case "ppt"
Set x = CreateObject("PowerPoint.A pplication ")
Set y = x.Presentations.Open(strfi lename)
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..
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.Applica
Set y = x.Documents.Open(strfilena
y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", WdSaveFormat.wdFormatHTML
y.Close
Case "xls"
Set x = CreateObject("Excel.Applic
Set y = x.Workbooks.Open(strfilena
y.SaveAs Left(strfilename, (Len(strfilename) - 3)) & "htm", xlHtml
y.Close
Case "ppt"
Set x = CreateObject("PowerPoint.A
Set y = x.Presentations.Open(strfi
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..
ASKER
Error Type:
Microsoft Excel (0x800A03EC)
SaveAs method of Workbook class failed
IT's in this line
y.SaveAs Left(strfilename,(Len(strf ilename) - 3)) & "htm", xlHtml
Microsoft Excel (0x800A03EC)
SaveAs method of Workbook class failed
IT's in this line
y.SaveAs Left(strfilename,(Len(strf
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.
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(strfi lename)
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.
Microsoft PowerPoint 2000 (0x80048240)
Presentations.Open : Invalid request. The PowerPoint Frame window does not exist.
In this line:
Set y = x.Presentations.Open(strfi
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Error Type:
Microsoft PowerPoint 2000 (0x80048240)
Application.Visible : Invalid request. Hiding the application window is not allowed.
In this line:
x.Visible = msoCTrue
Microsoft PowerPoint 2000 (0x80048240)
Application.Visible : Invalid request. Hiding the application window is not allowed.
In this line:
x.Visible = msoCTrue
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.
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.Applic ation")
Wrd.Workbooks.Open (Server.MapPath("excel.xls ")).Activa te
wrd.Visible = False
wrd.Application.ActiveWork book.SaveA s Server.MapPath("xlhtml.htm l"), 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
For excel version:
<%
On Error Resume Next
xlhtml = 44
Set Wrd = CreateObject("Excel.Applic
Wrd.Workbooks.Open (Server.MapPath("excel.xls
wrd.Visible = False
wrd.Application.ActiveWork
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.A pplication ")
wrd.Visible = True
Wrd.Presentations.Open (Server.MapPath("power.ppt "))
wrd.ActivePresentation.Sav eAs 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
For powerpoint:
<%
On Error Resume Next
ppSaveAsHTML = 12
Set Wrd = CreateObject("PowerPoint.A
wrd.Visible = True
Wrd.Presentations.Open (Server.MapPath("power.ppt
wrd.ActivePresentation.Sav
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