Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb5 to word97

Posted on 1998-12-10
3
Medium Priority
?
230 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 300 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…
Suggested Courses

721 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