Solved

vb5 to word97

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

832 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