Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp Word Creation

Status
Not open for further replies.

unicorn11

Programmer
Jun 10, 2000
392
IN
Hi

I want to create a word document via asp

I have created a Dll that will create word doc from a template

but it give the error

Microsoft Word (0x800A175D)
Could not open macro storage.
/abhi/totalfinaelf/ line 14


[red]
Code:
<%
 dim comp1, dri, dam
 set comp1 = server.CreateObject(&quot;WordCreater.TotalFinaElf&quot;) 
 

  ' the below line is line 14 
 dri = comp1.sCreateWord(&quot;unicorn11&quot;, &quot;asdfa&quot;, &quot;asfda&quot;, &quot;asdfad&quot;, &quot;asdfasdf&quot;, &quot;asdfaf&quot;, &quot;asdfad&quot;, &quot;asdfadf&quot;, &quot;asdfasdf&quot;, &quot;asdfad&quot;, &quot;asdfas&quot;, &quot;asdfas&quot;, &quot;asdfa&quot;, &quot;asdfa&quot;, &quot;asfda&quot;, &quot;asfda&quot;, &quot;asdfa&quot;, &quot;asdfasdf&quot;, &quot;asdfas&quot;, &quot;asdfas&quot;, &quot;asdfads&quot;)

%>
[/red]
if the same dll is to be called from a VB Project then it is running fine

what could be the error here ?

the VB code is
[red]
Code:
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)
 

 Dim wrdAp As Word.Application
 Dim wrdDoc As Word.Document
 
 Set wrdAp = CreateObject(&quot;Word.Application&quot;)
 Set wrdDoc = wrdAp.Documents.Open(&quot;C:\templete1.doc&quot;)

 wrdAp.Visible = True

    wrdDoc.Range.Fields(1).Result.Text = sSpecname
    wrdDoc.Range.Fields(2).Result.Text = sPass
    wrdDoc.Range.Fields(3).Result.Text = sCDT
    wrdDoc.Range.Fields(42).Result.Text = sQ141_1
    .
    .
    .
    wrdDoc.Range.Fields(57).Result.Text = sQ142_5

 wrdDoc.SaveAs (&quot;c:\temp\abhi1.doc&quot;)
 
 wrdDoc.Close
 wrdAp.Quit
  
 Set wrdDoc = Nothing
 Set wrdAp = Nothing
 sCreateWord = 1

End Function
[/red]

is there some sort of rights that have to be set for the word document to be saved at a particular location

regards Unicorn11
unicorn11@mailcity.com
[red]We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. --- Plato [red]
 
Thanks Everybody for your help

apparently the problem was with the Permission that I had.
I had to set then In ISS to allow the component to save a word document

I got that issue solved also
Now i can create a word doc and save all the data where ever i want in the word doc

regards s-)

Unicorn11
unicorn11@mailcity.com
[red]We can easily forgive a child who is afraid of the dark; the real tragedy of life is when men are afraid of the light. --- Plato [red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top