[AccessD] Writing raw RTF document using VBA

Tom Keatley tomk at multiline.com.au
Fri Oct 31 17:45:06 CST 2003


Gustav....

My apologies .... I should have stated my use for the RTF OCX is in REPORTS
....there is no problem binding to a field on a form but this changes in
reports and the control gives an error when you try to use it bound. My
workaround (at least the workaround someone on this list helped me with) was
to feed it from a text file. I have however downloaded the control you
suggested and when I re-do the function in my project I will give it a try.

REgards

Tom Keatley




> 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
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list