Hi -
I have written an ASP page to open a CV stored on the server, extract the text to a string, then format that string to enable a summary of the word document to be displayed as HTML. It runs fine when I host it on my local computer. However, when I run it on the server, it fails to run. It seems particularly upset about the line:
Set oWordApp = CreateObject("Word.Application")
Although the debugging is a bit vague. Does anyone know what the problem is/might be, and if there is a way around it? I tried fiddling around with the FileSystemObject methods, but haven't got very far. It seemed to be extracting garbage from the file ...
Thanks,
Ben
The listing is:
<HTML>
<HEAD>
<TITLE>Extraction Test</TITLE>
</HEAD>
<BODY>
<%
Dim oWordApp
Dim oDoc
Dim strWord
Dim Pos1
Dim Pos2
Dim text_array
Dim counter
Dim DocPath
counter=0
DocPath= "blah blah blah"
Set oWordApp = CreateObject("Word.Application")
Set oDoc = oWordApp.Documents.Open(DocPath)
strword = oDoc.range.Text
pos1 = InStr(strword, "KEY QUALIFICATIONS")
pos2 = InStr(strword, "CAREER SUMMARY")
text_array = Split( Mid(strword, pos1, pos2) , Chr(13))
While counter < Ubound(text_array)
If text_array(counter) = "KEY QUALIFICATIONS" THEN
%>
<b>KEY QUALIFICATIONS</b></p>
<%
Elseif text_array(counter) = "PROFESSIONAL AFFILIATIONS and EDUCATION" THEN
%>
</br><b>PROFESSIONAL AFFILIATIONS and EDUCATION</b></p>
<%
Else
Response.write text_array(counter)
%>
</br>
<%
End If
counter = counter +1
WEnd
oDoc.Close True
oWordApp.Quit
Set oWordApp = Nothing
Set oDoc = Nothing
Set strWord = Nothing
Set text_array = Nothing
%>
</BODY>
</HTML>
I have written an ASP page to open a CV stored on the server, extract the text to a string, then format that string to enable a summary of the word document to be displayed as HTML. It runs fine when I host it on my local computer. However, when I run it on the server, it fails to run. It seems particularly upset about the line:
Set oWordApp = CreateObject("Word.Application")
Although the debugging is a bit vague. Does anyone know what the problem is/might be, and if there is a way around it? I tried fiddling around with the FileSystemObject methods, but haven't got very far. It seemed to be extracting garbage from the file ...
Thanks,
Ben
The listing is:
<HTML>
<HEAD>
<TITLE>Extraction Test</TITLE>
</HEAD>
<BODY>
<%
Dim oWordApp
Dim oDoc
Dim strWord
Dim Pos1
Dim Pos2
Dim text_array
Dim counter
Dim DocPath
counter=0
DocPath= "blah blah blah"
Set oWordApp = CreateObject("Word.Application")
Set oDoc = oWordApp.Documents.Open(DocPath)
strword = oDoc.range.Text
pos1 = InStr(strword, "KEY QUALIFICATIONS")
pos2 = InStr(strword, "CAREER SUMMARY")
text_array = Split( Mid(strword, pos1, pos2) , Chr(13))
While counter < Ubound(text_array)
If text_array(counter) = "KEY QUALIFICATIONS" THEN
%>
<b>KEY QUALIFICATIONS</b></p>
<%
Elseif text_array(counter) = "PROFESSIONAL AFFILIATIONS and EDUCATION" THEN
%>
</br><b>PROFESSIONAL AFFILIATIONS and EDUCATION</b></p>
<%
Else
Response.write text_array(counter)
%>
</br>
<%
End If
counter = counter +1
WEnd
oDoc.Close True
oWordApp.Quit
Set oWordApp = Nothing
Set oDoc = Nothing
Set strWord = Nothing
Set text_array = Nothing
%>
</BODY>
</HTML>