Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Writing to a Word document from an ASP page

Posted on 1999-07-20
2
Medium Priority
?
157 Views
Last Modified: 2013-12-25
How do I open a Word document and write to it from an ASP page using VB Script?
0
Comment
Question by:AllyCat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:AllyCat
ID: 1864205
Adjusted points to 200
0
 
LVL 5

Accepted Solution

by:
mayhew earned 400 total points
ID: 1864206
I wrote this in VB but it should be all good in asp.

I'm not positive that you need the app.quit at the end, though.

I'll test this tonight and let you know if I have any trouble.

Or if you play with, let me know if you have any success with it.

Hope this helps.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    'Create Word object.
    Set app = CreateObject("Word.Application")
   
    'Open new document.
    app.Documents.Add
   
    'Open an existing document.
    app.Documents.Open "d:\don\test.doc"
   
    'If multiple documents open, activate the one you want.
    app.Documents(2).Activate
   
    'Type text.
    Selection.TypeText Text:="I love to program computers."
   
    'Save new document.
    app.ActiveDocument.SaveAs "d:\don\new.doc"
   
    'Close that document.
    app.ActiveDocument.Close
   
    'And save it.
    app.ActiveDocument.Save
   
    'And close document.
    app.ActiveDocument.Close
   
    'Close the app.
    app.Quit
    Set app = Nothing

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question