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
Solved

stuff text into MS Word from VB

Posted on 2002-05-02
2
124 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 50 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 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