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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do u create a word doc (as opposed to opening)? 4

Status
Not open for further replies.

mijulie

Programmer
Jun 21, 2001
36
0
0
IE
If this is the code for opening an existing doc, anyone know what command i need to create a doc?

Set Word = CreateObject("Word.Application")
Word.Visible = TRUE
Word.Documents.Open("C:\My Documents\myfile.doc")
 
If u want to create the word document on the client side and then let the user to use it from IE u need to use
Response.ContentType function in your asp file witch create a doc file as response and in IE all u see is an embeded word interface in your browser with the text u have introduced from your asp file...
If u are interested i could send u an example...
The CreateObject method is a good one but if the client did not accept to execute an activex component or an script u have an problem... ________
George, M
 
Shadow,
Yes i have encountered this problem, ideally i need to create the doc on the server
and only show it to the user if requested. could you please send me the example.
my email is declanshanaghy@yahoo.com

Thanks
 
Try this
Code:
<%@ Language=VBScript %>
<% Response.ContentType = &quot;application/msword&quot; %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<table border=1>
<tr>
	<th>Column 1</th>
	<th>Column 2</th>
</tr>
<tr>
	<td>Value1</td>
	<td>Value2</td>
</tr>
<tr>
	<td>Value1</td>
	<td>Value2</td>
</tr>
<tr>
	<td>Value1</td>
	<td>Value2</td>
</tr>
</table>
	
</BODY>
</HTML>
________
George, M
 
Does some library path need to be set up on the server, or maybe referenced from inside the script or something?
When i execute the exact script from above i get

Technical Information (for support personnel)

Error Type:
(0x80010105)
The server threw an exception.
/gfiles_web/wordtest1.asp, line 5

Line 5 is: Set objWord=CreateObject(&quot;Word.Application&quot;)
 
how can one use wordviewer and or excellviewer to show docs

using

<% Response.ContentType = &quot;application/msword&quot; %>
 
U need to have installed on your machine both Word and Excel... not on the server.
Whend the page cames up is interpreted as a doc or excel document ________
George, M
 
how to fetch the data from database
on the onchange(or any ) event event of combobox?
 
Hi,
I gonna put some images in a .doc document using asp code.
any suggestion?
ahooman@yahoo.com
 
I have a Server that has not got Word installed on it and I am trying to run the following script on a clients machine :

<script language=&quot;VBScript&quot;>
Dim objWord
Set objWord=CreateObject(&quot;Word.Application&quot;)
.....

The client machine has office installed on it. I get the following error when I run the above script :

Error Type:
Microsoft VBScript runtime (0x800A01AD)
ActiveX component can't create object: 'Word.Document'

Please help as I can't seem to figure out why this won't work. The microsoft site said that this is the correct syntax for doing this so I am really stumped.
 
Hi all. Finally I found this wonderful place. I am not new with ASP, but my boss ask me to make an automatic word document from ASP, which is very new to me.

btw, I would like to ask how to place my table at the end of the document, since I have tried many times and the table always was created at the beginning. Is there anything (at the range?) i can set?

Thanks a lot.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top