Create Word Document with ASP

Results 1 to 2 of 2

Thread: Create Word Document with ASP

  1. #1
    Join Date
    Dec 1969

    Default Create Word Document with ASP

    Hi <BR><BR> I want to create a word document via asp<BR><BR> I have created a Dll that will create word doc from a template <BR><BR> but it give the error<BR><BR> Microsoft Word (0x800A175D)<BR> Could not open macro storage.<BR> /abhi/totalfinaelf/www_asp/telecharger2.asp, line 14<BR><BR> <BR>&#060;%<BR> dim comp1, dri, dam<BR> set comp1 = server.CreateObject("WordCreater.TotalFinaElf") <BR> <BR><BR> &#039; the below line is line 14 <BR> dri = comp1.sCreateWord("unicorn11", "asdfa", "asfda", "asdfad", "asdfasdf", "asdfaf", "asdfad", "asdfadf", "asdfasdf", "asdfad", "asdfas", "asdfas", "asdfa", "asdfa", "asfda", "asfda", "asdfa", "asdfasdf", "asdfas", "asdfas", "asdfads")<BR><BR>%&#062;<BR><BR>if the same dll is to be called from a VB Project then it is running fine <BR><BR>what could be the error here ?<BR><BR>the VB code is <BR><BR>Function sCreateWord(sSpecname, sPass, sCDT, sQ141_1, sQ141_2, sQ141_3, sQ142_1, sQ142_2, sQ142_3, sQ142_4, sQ142_c, sQ143_1, sQ143_2, sQ143_3, sQ143_c, sQ144_1, sQ144_2, sQ144_3, sQ144_4, sQ144_5, sQ144_c)<BR> <BR><BR> Dim wrdAp As Word.Application<BR> Dim wrdDoc As Word.Document<BR> <BR> Set wrdAp = CreateObject("Word.Application")<BR> Set wrdDoc = wrdAp.Documents.Open("C: emplete1.doc")<BR><BR> wrdAp.Visible = True<BR><BR> wrdDoc.Range.Fields(1).Result.Text = sSpecname<BR> wrdDoc.Range.Fields(2).Result.Text = sPass<BR> wrdDoc.Range.Fields(3).Result.Text = sCDT<BR> wrdDoc.Range.Fields(42).Result.Text = sQ141_1<BR> .<BR> .<BR> .<BR> wrdDoc.Range.Fields(57).Result.Text = sQ142_5<BR><BR> wrdDoc.SaveAs ("c: empabhi1.doc")<BR> <BR> wrdDoc.Close<BR> wrdAp.Quit<BR> <BR> Set wrdDoc = Nothing<BR> Set wrdAp = Nothing<BR> sCreateWord = 1<BR><BR>End Function<BR><BR><BR>is there some sort of rights that have to be set for the word document to be saved at a particular location <BR><BR>regards

  2. #2
    Join Date
    Dec 1969

    Default RE: Create Word Document with ASP

    Perhaps try setting "Write" permissions on that dir where you store the output file to "Full Access" to "Everyone"? I know that is insecure,but if it works, then just find out which security permissions you actually need and then adjust as neccessary to allow your .DLL to work and still maintain security.<BR><BR>I had done something similar with a .DLL that allows file uploads and writes the graphic file to disk. Since this was a company Intranet project, security was not an issue in my case.<BR><BR>Hope this helps,<BR><BR>Reginald Dawson

Posting Permissions

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