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!

Writing to a Word Doc

Status
Not open for further replies.

AgentM

MIS
Jun 6, 2001
387
US
I want to open Word when the user clicks a button on a asp page. The Word doc should also contain some of the fields from my asp page.
Can somebody guide me to how this can be done?

Thank you in advance for all the help

 
I know this has been addressed before.
I managed to openWord and write to it
But I can't get it to write to a bookmark.
Can anybody help?

 
Got it....
Here's the soln

dim WordApp
set WordApp = GetObject("","Word.Application")
with WordApp
.Visible = TRUE
.Documents.open "C:/filename.dot"

.Documents.bookmarks("bookmark_name").select: .selection.text = "Test"
End with
 
Hi AgentM,
I'm glad that you solved you problem. Could you tell how you deal with permissions problems since MS Word is an .exe and, hence out of process? Do you use some package on MTS to interact with Word?
Thank you.
 
I am not sure, Let me check on that. Thanks for the insight. Something to look out for ....

The problem now is generating a Word Doc that fits with the dynamic table generated by ASP...

Any ideas????

 
The reason I was asking is that I never seemed to get this to work. Whenever I tried to launch any of applications like Word, Access etc. from .asp pages, the result was just error message stating that server cannot create object or some permissions error. And as far as I understand, creating a middle-tier component for interaction between .asp and .exe and placing it on MTS is the only way to do it. So if you'll figure out how to do it or at least, how your system is set up, please post it to the forum.
Thnx.
 
Wow, this is exactly what I'm trying to do too!! I need a cheap way (besides purchasing activePDF) to pull information from my SQL database and put in format that can be easily printed on Avery 5160 labels. This has been a huge task. Currently its running on a standard ASP page, but viewers on AOL and/or Netscape are having problems getting the 3rd and 4th pages to fit. Is printing out to word a realistic solution? :-V
 
Try to use Response.ContentType in asp
<% Response.ContentType = &quot;application/msword&quot; %>
________
George, M
email : shaddow11_ro@yahoo.com
 
This is for guestg.
Permission problems??/
I am running IIS on Win 2K I have enabled Script source Access and Read in the tab Home Directory for the default web site.
I don't know if this is going to help you.
But no MTS components are involved.

 
Use
<% Response.ContentType = &quot;application/msword&quot; %>
and then generate the page as u like, there will be openned by the explorer with an word instance in it...otherwise u will need to upload the document to the client and then open with the word from client side script (is not possible from server side script) but if u need to open an word or excel or anyting else u need to use ContentType with the proper value...
U get all the values from your registry in the extension area...
exemple

.doc - .... - the values
-Content Type - application/msword
.xls - will be the same if u look

and so for anny extension
________
George, M
email : shaddow11_ro@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top