Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / October 2004



Tip: Looking for answers? Try searching our database.

Need some help to generate a word Document from within an ASP page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hamid Djam - 24 Oct 2004 07:13 GMT
Hi,
I have been trying to generate a word document from within my ASP
page. When I try to bring up the page and generate a word doc the
following error is generated. Any help is greatly appreciated. My Word
version is Microsoft Word 2002, ( from the HELP---> ABOUT menu).

~~~~~~~~~~~~~~~~~~~~~~CODE SAMPLE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<%
Sub CreateAppraisalForm(Manager,Email,Appraisee)

       

       
       Set WordApp = Server.CreateObject("Word.application")

       Set WordDoc = WordApp.Documents.Add()
       
       WordApp.Application.Visible = False
       
       Set MyRange1 = WordDoc.Paragraphs.Add.Range
       MyRange1.InsertBefore("Appraisal Form")       
       MyRange1.Style = "Heading 1"       
       
       Set MyRange1 = WordDoc.Paragraphs.Add.Range
       MyRange1.InsertBefore("Manager: " & Manager & vbcrlf &
"Appraisee: " & Appraisee)
       MyRange1.Font.Bold = true
              
       Set MyRange1 = WordDoc.Paragraphs.Add.Range
       MyRange1.InsertBefore(vbcrlf & "Please fill in all the required
sections and return to HR via the internal mail system.")

       WordDocPath = Server.MapPath("\folder")
             WordDoc.SaveAs WordDocPath & "\sample.doc"
        WordDoc.Close
        WordApp.Quit
   
        Set WordDoc = Nothing
        Set WordApp = Nothing   
End Sub

call CreateAppraisalForm("Manager","john@mmm.com","Appraisee11")
~~~~~~~~~~~~~~~~~~~~~~~END CODE SAMPLE~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks.

Hamid Djam.
JM Freixes - 25 Oct 2004 10:33 GMT
Try reading the article 288368 and related in the Knowledge Base.

> Hi,
> I have been trying to generate a word document from within my ASP
[quoted text clipped - 40 lines]
>
> Hamid Djam.
Hamid Djam - 25 Oct 2004 23:58 GMT
> Try reading the article 288368 and related in the Knowledge Base.
>
[quoted text clipped - 42 lines]
> >
> > Hamid Djam.

I am not sure which knowledge base you are refereing to.
JosepM - 26 Oct 2004 18:01 GMT
Try http://support.microsoft.com/default.aspx?kbid=288368

> > Try reading the article 288368 and related in the Knowledge Base.
> >
[quoted text clipped - 44 lines]
>
> I am not sure which knowledge base you are refereing to.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.