Solved

vb5 to word97

Posted on 1998-12-10
3
217 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

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