Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Autotext entries as bookmarks??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ivan Debono - 24 Dec 2004 10:42 GMT
Hi all,

I'm using VB6 to automate MSWord to create a document from a template that I
define. The template has Autotext entries, bookmarks and styles.

I'd like to achieve the following though code:

1. Get hold of an autotext entry from the template, fill it as necessary
with records from a database, set styles etc.
2. Keep this autotext entry in memory (not placing it in the document)
3. Get other autotext entries, or whatever
4. Place the autotext enty from memory into a bookmark.

Is this possible? Issue 1 is not problem. I still thinking how to approach
issue 2 though. Any ideas?

Thanks,
Ivan
Word Heretic - 25 Dec 2004 02:12 GMT
G'day "Ivan Debono" <ivanmdeb@hotmail.com>,

What effect are you trying to achieve? Your stated method is quite
unclear and 'useless'.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice

Ivan Debono reckoned:

>Hi all,
>
[quoted text clipped - 14 lines]
>Thanks,
>Ivan
Ivan Debono - 25 Dec 2004 05:30 GMT
Currently I have a situation where I can do something like the following:

Name Surname
Address

Date

Item1 Description1 Qty1
Item2 Description2 Qty2

etc...

The first section is the header autotext and below is the details autotext.
Each autotext has its bookmarks. In my code I insert the first autotext,
replace its bookmarks with data. The loop through the details recordset,
insert the second autotext and replace bookmarks. Note that the data comes
from 2 different tabless

This works fine if everything is under each other. Now I want something
different and this time I need data that comes from 5 or 6 different tables.
To keep it simple, I need a template like the following (just an example):

Name Surname                        Item1 Description1 Qty1
Address                                    Item2 Description2 Qty2
                                               Item3 Description3 Qty3
Date

Notes1
Notes2
Notes3

etc...

This cant be achieved with my current method, so I was thinking of an
alternative method:

1. Design the template exactly as I want it to look like and store it
completely as an autotext and call it Main.
2. Individual fields will be Main's bookmarks.
3. The Items section will also be stored as an autotext and called Items.
4. Items fields will be Items' bookmarks (maybe with Item prefix, eg,
ItemName, ItemDescription, etc)
5. Do 3 and 4 for the Notes section.
6. Furthermore, add 2 bookmarks for Main and call them ItemDetails and
NotesDetails for example.

What's the reason? Well, then I can do something like this in my code:

1. Insert Main autotext
2. Replace Main's bookmarks with fields
3. At the end of the document (or preferably somewhere else), insert Items
autotext and replace bookmarks accordingly.
4. Cut from the beginning of the Items text to the end.
5. Place the text in Main's ItemDetails boomark.
6. Do the same for Notes and NotesDetails.

That's what I'm trying to achieve. I hope it's clear!!

What I still didn't figure out 100% is points 3,4,5 above.

Any suggestions?

Ivan

> G'day "Ivan Debono" <ivanmdeb@hotmail.com>,
>
[quoted text clipped - 27 lines]
>>Thanks,
>>Ivan
Doug Robbins - Word MVP - 26 Dec 2004 04:31 GMT
Assuming that the 5 or 6 tables are in a database, I would suggest that you
use an Access report to achieve what you are after.

Alternatively, see the "Multiple items per condition" item under the
"Special merges" section of fellow MVP CIndy Meister's website at

http://homepage.swissonline.ch/cindymeister/MergFram.htm

Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP

> Currently I have a situation where I can do something like the following:
>
[quoted text clipped - 91 lines]
> >>Thanks,
> >>Ivan
Ivan Debono - 26 Dec 2004 06:05 GMT
They are actually in an Access database and an access report will simplify
things. But I can only distribute the database and ADO and not the Access
engine, so the enduser can design his own reports.

My only alternative would be Word

Ivan

> Assuming that the 5 or 6 tables are in a database, I would suggest that
> you
[quoted text clipped - 108 lines]
>> >>Thanks,
>> >>Ivan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.