Difficult ASP to Word Problem

Results 1 to 2 of 2

Thread: Difficult ASP to Word Problem

  1. #1
    Join Date
    Dec 1969

    Default Difficult ASP to Word Problem

    the site http://www.esubonline.com/demosite/BranchOffice/JobSite/letter/v25esub/viewletterlog.asp<BR>Click on one of the letters, say SAVE Changes<BR>Then Create the Microsoft Word Document<BR><BR>I use the code at the bottom of the page to create the word document. Of course it works fine on my machine.<BR><BR>On other machines Windows installer launches, and on other machines it asks the user what format they want to open the document in IE RTF, Text only, Word 97, etc...<BR><BR>When the user selects Word 97 they get an invalid format error.<BR><BR>THE QUESTION IS: What do I have to do to enable this to open in word with out any errors?<BR><BR><BR>This article is the closest thing to helping me that I could find.<BR>---Cut and paste the below into your address line of your browser---<BR>http://support.microsoft.com/support/kb/articles/Q270/9/06.ASP?LN=EN-US&SD=gn&FR=0&qry=Word&rnk=3&src=DHCS_MSPSS_gn_SRC H&SPR=ASP<BR>-----End Cut----<BR><BR><BR>-----MY CODE----<BR>&#060;% <BR>strDocName = request.form("FileName")<BR>strDocument = request.form("Document")<BR><BR>strDocument = replace(strDocument, chr(13), "<BR>")<BR><BR>strDocument = replace(strDocument, "&apos;", "&#039;")<BR><BR> Dim fso, tf, fn<BR> fn = server.MapPath("sentletters/" & strDocName & ".doc")<BR> &#039; Set fso = CreateObject("Scripting.FileSystemObject")<BR> &#039; Set tf = fso.CreateTextFile(fn, True)<BR><BR> &#039; tf.Write strDocument<BR> &#039; tf.Close<BR>strNewfile = "sentletters/" & strDocName & ".rtf"<BR><BR> Dim MyFile, sFileName<BR> Set fso = CreateObject("Scripting.FileSystemObject")<BR> sFileName = strNewFile<BR> Response.Write sFileName<BR> Set MyFile = fso.CreateTextFile(Server.MapPath(".") & "\" & _<BR> sFileName, True)<BR><BR> MyFile.Write strDocument<BR><BR> MyFile.Close<BR><BR> Response.Write _<BR> "&#060;META HTTP-EQUIV=""REFRESH"" Content=""0;URL=" & sFileName & """&#062;"<BR><BR> %&#062;<BR><BR>THANKS IN ADVANCE (TIA)<BR>Jason Buck<BR>jbuck@esubinc.com

  2. #2
    Join Date
    Dec 1969

    Default RE: Difficult ASP to Word Problem

    i think you have to follow the RTF specification while creating the rtf document.that could be the reason for word saying "Invalid Format".<BR>

Posting Permissions

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