Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2004, 05:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Creating a "WORD" document in ASP

Hi All,

I am creating a "Word" document in ASP 3.0.
I need help to insert a "Picture - gif file" at the bottom of the document.

I tried the following codes;

"
dim oWord, oDoc, rangeBold


Set oWord = CreateObject("word.application")
oWord.Application.Visible = true

Set oDoc = oWord.Documents.Add()

' Creating a new paragraph
Set rangeBold = oDoc.Paragraphs.Add.Range
rangeBold.InsertBefore("Signature")
rangeBold.font.bold = True
rangeBold.font.size = 11
rangeBold.font.name = "Arial"


' Inserting a "Picture' file.
oDoc.Shapes.AddPicture "c:\mypicture.gif"
"

It inserts the "Picture" file on the top of the document, which is correct. Because I didn't specify a certain paragraph range for the picture file. But, I don't know the syntax.

I also need a syntax for "Full justify".

Thanks for your help,

mcinar


__________________
MCinar

Love all the creatures because of the creator.
 
Old November 13th, 2004, 12:23 PM
Authorized User
 
Join Date: Sep 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mcinar,

I have the almost same problem related to word application in ASP 3.0. what is my problem is, i could not create object for Word.Application. what did you do getting work with word.application. should we have to install the MS Word in Web Server or do you know from where we can get the Word.Application DLL through Online.

reply me soon !!!!!

Joseph






 
Old November 14th, 2004, 11:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Joseph,

I was modifying the existing codes at the different location. And, I tried to test it in my environment.
I had the similar problem that you had and I will try to find out and let you know.

Take care...

mcinar



 
Old December 3rd, 2004, 03:58 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This might solve your problem regarding createObject:
http://support.microsoft.com/support.../q195/8/26.asp

as for the original posting, you might find some samples here under client-side solutions to help you out:
http://msdn.microsoft.com/library/de...sofficedev.asp

It's an issue with security settings since the server is essentially attempting to open up an application on the client side.



 
Old December 3rd, 2004, 10:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Dokkyo,

Your information was very helpful and it solved my problem.

Thanks for your help.

mcinar


 
Old December 3rd, 2004, 10:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Joseph,

I got some help from "Dokkyo" and it helpmed me.
Here is the information;

This might solve your problem regarding createObject:
http://support.microsoft.com/support.../q195/8/26.asp

as for the original posting, you might find some samples here under client-side solutions to help you out:
http://msdn.microsoft.com/library/de...sofficedev.asp

It's an issue with security settings since the server is essentially attempting to open up an application on the client side.

Take care...

mcinar

 
Old March 13th, 2006, 02:05 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set oWord = CreateObject("word.application")
oWord.Application.Visible = true
Set oDoc = oWord.Documents.Add()

When I try to run this code it is giving me this error.

Microsoft Word (0x800A175D)
Could not open macro storage.
/heloc/word.asp, line 6

Please it is very urgent.

 
Old February 24th, 2007, 02:21 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi All,

I am creating a "Word" document in ASP 3.0.
my code is working proprly in explorer-MS Internet Explorer
but it gave problem in mozilla firefox.
i think, i have wrong written contenttype.
my code is below.............
-------------start code---------
Response.ContentType = "text/Doc"
response.AddHeader "content-disposition", "attachment; filename="NILESH PATEL" .Doc"
Response.write "NAME :NILESH PATEL " & vbcrlf
response.write "FULL NAME : NILESH PATEL M." & vbcrlf
response.write "JOB TITLE:PROGRAMMER" & vbcrlf
-------------end of code---------
i also use mcinar's code but it will gave me error
like-Microsoft Word (0x800A175D)
Could not open macro storage.

I also need a syntax for "Full justify".

Thanks in advance for your help,

NILESH PATEL

 
Old March 12th, 2007, 07:41 AM
Authorized User
 
Join Date: Jan 2007
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saurabhj Send a message via Yahoo to saurabhj
Default

dokkyo has given a very useful urls

-Saurabh
 
Old April 10th, 2007, 08:13 AM
Registered User
 
Join Date: Apr 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to krishnanincts
Default

i have to create a word document with header and footer.the text to be displayed is in entered into a text box and button is pressed then word is to be generated.i should not use the msword object. i have to use only xml/xslt.it should be in c#..... can you help me








Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating word doc. thru .dot or XML document manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 2 March 1st, 2006 07:18 AM
Creating a "WORD" document in ASP mcinar Classic ASP Basics 7 June 30th, 2005 03:44 PM
Creating New Document In Word Through vba Hari_Word Excel VBA 1 July 22nd, 2004 05:50 PM
Creating Table dynamically in Word Document ajish_jose Excel VBA 0 September 30th, 2003 11:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.