?
Solved

stuff text into MS Word from VB

Posted on 2002-05-02
2
Medium Priority
?
130 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
[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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

764 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