ASP Word automation

Results 1 to 2 of 2

Thread: ASP Word automation

  1. #1
    Join Date
    Dec 1969

    Default ASP Word automation

    Hi<BR><BR>I am attaempting to use word automation on my web server to create a word doc from an ASP file.<BR><BR>So far I have this code:<BR><BR><BR>&#060;%<BR><BR><BR>dim objWord, objDoc, str<BR><BR><BR>set objWord = createobject("word.application")<BR>Set objDoc = objWord.Documents.Add <BR><BR>str= "updated"<BR>objDoc.content = str<BR><BR>objDoc.SaveAs(Server.mappath("/test.doc"))<BR><BR>objDoc.Close false<BR>Set objDoc = nothing<BR><BR>objWord.Quit <BR>Set objWord=nothing<BR><BR>%&#062;<BR><BR>Which simply starts an instance of word, makes a new document, adds the contents of the str variable to the document, then saves it.<BR><BR>What I need to do is export HTML (after ASP processing) to the word doc so that it&#039;s intepreted as HTML and not as text. How do I do this?<BR><BR>e.g.<BR><BR>I want to be able to send the word doc<BR><BR>"&#060;b&#062;&#060;i&#062;bold italic text&#060;/b&#062;&#060;/i&#062;"<BR><BR>and for it to intepret the html not just display the text string.<BR><BR>Cheers<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP Word automation

    You need to send the &#060;html&#062; tag to the document to open it as html! Don&#039;t forget &#060;/html&#062; at the end!

Posting Permissions

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