Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I use a thin client program at my work called WRQ which has VBA built into it. I'm attempted to scrape information off of my screen and place it into a word document.
I've figured out how to add simple text to a word doc by using the code:
Dim Word As Word.Application
Set Word = CreateObject("Word.Application")Word.Visible = True
Word.Documents.Add
Word.Selection.TypeText Text:="baaaah"But i'm having trouble trying to figure out how to add information into a templated word doc. I have a form that looks like this:
Name of Claimant: ___________
Date of Accident: ___________And I want to add the infmation where the underscored line is. Does anyone know how this is done? I'm not to familiar with VBA, and i'm kind of learning as I go.

I found that the search and replace functions using Word with Visual Basis a bit cumbersome and a little on the slow side.
The solution I used was to use an RTF file as a template. Load the template file into an RTF control. Use the RTF search and replace functions to insert the information. Save the file as and RTF file then load it into Word and save it as a DOC file.
You will of course be restricted to the formatting facilities available to RTF.
One advantage of this method is that you are not restricted to a particular version of Word. I am using a function that was originally designed to run with Office 97. It is still running unaltered with Office 2003.
In this instance it is using information extracted from an Access database to generate a Word DOC.
Stuart

![]() |
Any Outlook / IMAP expert...
|
Office Outlook mail folde...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |