[AccessD] Writing raw RTF document using VBA

Gustav Brock gustav at cactus.dk
Sat Nov 1 12:27:40 CST 2003


Hi Tom

Thanks Tom, I can follow your approach. However, I do have the ocx
running and bound to a memo field, thus I have the RTF memos build
(and users type them in). My only task is to concatenate these micro
documents into one RTF document.

The ocx should happily work with Access 97. If not, you may have it
inproperly registered.

Here is a utility I found many years ago; it is still on-line:

  http://www.sareleku.com/DesktopDefault.aspx?tabid=43

It will install the RichText ocx so you can work with even without the
Access Developer edition which is quite handy if you ever need to do
some work on-site at a client.

/gustav


>> The client has got new budgets and is again asking for this:
>> 
>> > My simple need (which I never got solved) was how to assemble an
>> > rtf-formatted field from many records (essentially each an rtf
>> > document) into one rtf document, stripping headers etc. from each
>> > record and adding a header etc. to the final document.
>> 
>> Does anybody have a clue how to attack it?

> Gustav..

> I use rtf in one of my projects in the way you describe and although my method is very clunky .... it works and has been for some years now .....If you discover a cleaner/less clunky way I for one
> would be very interested in hearing about it 

> My project is still using A97 and the biggest problem I found was the fact that the RTFocx will not bind directly to a table field or query so I had to use the control unbound and feed it from an
> rtf file on the hard drive .....whether this has changed in A2000 or A2002 I dont know   

> Hmm...the pasted text below (looks crap in my email client) is produced by the function below it ....the result is saved as an rtf text file and then fed to the rtf OCX at runtime. 

> Setting it up is failrly simple ....simply set up a document the way you would like to see it in wordpad (or any rtf editor) and then nip the rtf codes from the raw rext and wrap those around a
> variable in the function. the result of the rtf is below and then below that is the rtf code itself. Take RTFCODESTART from the start and then save as an rtf document to open in wordpad or similar.
> The last line (you will see it as 4) is a font I have built with the rating symbols we use and 4 happens to correspond to "M"rating (mature audience). 

> I wrote this very early in my (ahem!) development and I think if I was to write it now I would use case statements instead of if then else's and also store the rtf codes in a table. Then I would
> use a find replace function so that I could vary the text produced (similar to the way early word processors used to work to acheive bold text etc with tags) eg <@BOLD@>I want this to be
> bold<@/BOLD@> 

> I seem to remember you and I discussing this a few years ago Gustav.....
> Hope it helps 

> Regards

> Tom Keatley 



More information about the AccessD mailing list