?
Solved

stuff text into MS Word from VB

Posted on 2002-05-02
2
Medium Priority
?
134 Views
Last Modified: 2010-08-05
I'm reasonably conversant w/ VB and VBA but I can't figure out how to do what I believe should be a simple operation which is to take a bunch of text (call it a long string) and stuff it into MS Word (opening an instantiation of Word as part of the process). I can worry about formatting & stuff later, if someone can just push on my chest to get me breathing.

Thanks for your time.
0
Comment
Question by:HobbitHouse
2 Comments
 
LVL 3

Accepted Solution

by:
nzjonboy earned 200 total points
ID: 6987195
check out this basic tutorial

http://www.vbsquare.com/beginning/begword/

nzjonboy
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6987285
reference microsoft word object library:

Dim wdApp As New Word.Application
Dim wdDoc As Word.Document

Set wdDoc = wdApp.Documents.Add
wdDoc.Content.InsertBefore "WRITE THIS TO THE NEW DOCUMENT"
wdDoc.SaveAs "C:\windows\desktop\testDoc.doc"

wdDoc.Close
Set wdDoc = Nothing
wdApp.Quit
Set wdApp = Nothing
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 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