Solved

vb5 to word97

Posted on 1998-12-10
3
220 Views
Last Modified: 2010-05-03
Is there a way to convert a form to a text document in word97?   My form contains some a output data, i make a print (print form) but is there a way to print to a file so that word can open it. ( i thougt to make a document in word and make a bookmark, after that vb must to copy the result to the bookmark but it do not work.....) what can i do??
0
Comment
Question by:nimicheck
[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
3 Comments
 

Author Comment

by:nimicheck
ID: 1449273
Edited text of question
0
 
LVL 3

Accepted Solution

by:
jjmartin earned 100 total points
ID: 1449274
There are two ways I know of to export you text to word.  By code, and using the export function of Criystal Reports 6. The code is below, it is pretty basic, and doing any formating can get real complicated.  If you go to www.seagate.com, you can download Crysatl Reports 6 for free.  CR6 has an export function that is pretty easy to use, and does a decent job on formating.  The version of Crystal Reports that comes with VB5 does a terrible job of exporting to word.

'This example open a new word document and write to the file, you must be using Word 95 or 97

Private Sub Command1_Click()
Dim oWord As Word.Application
Dim oDoc As Word.Document

Set oWord = New Word.Application

' Open an existing file this way
'oWord.Documents.Open(...)

' Open a new document
Set oDoc = oWord.Documents.Add

oDoc.Content.InsertAfter "Mary had a little lamb," & vbCrLf & "Her fleece was white as snow"

oDoc.SaveAs "C:\Junk.Doc"
oDoc.Close

Set oWord = Nothing

End Sub

0
 

Author Comment

by:nimicheck
ID: 1449275
Thanks,
but an other question, is it possible to export my output data from my form (vb5) to an existing word file by using bookmarks?
How does it work (can you give an example ....)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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 In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

751 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