borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Newbie)Next Topic (How can re-index the dynamic controls array after remove an control item? ) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Text generation in WORD
Poster Message
Stephen Mika
Level: Guest


icon Text generation in WORD  Archived to Disk

I wonder if anyone can help me either with some guidance or perhaps some programming  for a fee. I need to produce reports using WORD. In order to save time when writing reports I have created over 800 paragraphs of standard text as below. Each paragraph is broken up into several sections seperated by a letter in brackets. What I would like to do is to type  the paragraph number and then the letters and the relevant text is copied from a text file or database and inputted automatically into the report in WORD. Some example paragraphs in my text file are as follows -

51    There is [A] a terraced [B] a semi-detached [C] an attached [D] a detached [E] an integral [F] single [G] double [H] triple [ ] garage with the property. [I] This is located in a separate block.

113     We believe this has been caused by [A] foundation movement [B] wall tie corrosion, [C] internal alterations, [D] inadequate restraint, [E] inadequate support, [F] possible tree root action, [G] ... [ ] and [H] considerable remedial work is necessary. [I] a more detailed investigation is required.


For example typing 51AI in a WORD document then the following text would be created

There is a terraced garage with the property. This is located in a separate block

Is this easy to do in Visual Basic?  Any help would be appreciated.

08-04-2002 at 02:10 PM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: Text generation in WORD  Archived to Disk

Possible I believe, however I'd probably do the following:

Open word, create a new template. In the template, use the "Visual Basic editor" to create macros to run. The macros are just single or multiple VB routines, so you can (I think, never tried) open a DB, or just put in text stored within the template. The VB editor allows you to create a entire document with code, search and replace, and many other things, so it is possible (did a similar thing with dates once, needed a date range on a report).

Of course, you'd have to 1) schedule the macros to run at certain times (requires low macro security, default is high), or 2) user to manually run the macros.

08-04-2002 at 07:25 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: Text generation in WORD  Archived to Disk

You'd have to save the template, and obviously, the new documents would have be be done using the template, not the normal.dot template.


____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

08-04-2002 at 07:27 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : Text generation in WORD
Previous Topic (Newbie)Next Topic (How can re-index the dynamic controls array after remove an control item? ) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder