Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a document based on some template
Message
From
12/02/2002 17:03:35
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00619135
Message ID:
00619178
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Hilmar,
>
>To be honest, I haven't done anything like this before. So, how should I proceed? I have a document. This document contains some variable information, like Date and some other fields. So, I choose Save as ... option, choose Template, but I guess, I need to insert something. I found MailMerge and MergeField. Is it what I need? Could you please provide more guidance?

MergeField, etc. are for MailMerge - when you have variable data in a table.

In the simplest case, a template is a text which you use as a starting point (advanced templates can also have formatting information and Word macros, but you don't need this for now).

I didn't do exactly what you need - but I think I would insert placeholders for variable information with special symbols. I will assume a letter, but you can extend this logic to any sort of document:
(This is the Word document)
Boston, *Date*

Dear *Name*,

We appreciate your generous donation of *Amount*, which will assuredly be a great help towards our Noble Cause.

Regards, 

Nadya
The document above should be saved as a template (donation.dot)

Then, create a document based on the template. Don't press the "New Document" button on the toolbar, since this will create a document based on the normal template. Instead, use the command "File | New" (?), and select the "donation" template.

Then, search on *Name*, etc., and use the insert command to insert the variable texts.

That should be fairly easy. For the automation part, save a macro, do all of the above, and look at the generated code. Try to convert it to VFP.

HTH.

Do you need help in getting started with automation? That is, getting a document reference?


... Well, I'll leave soon, and be back tomorrow in the early morning, at 11:00 UTC.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform