Merging Rich Text/HTML

I have a database that merges into docx files. This works perfectly (after much effort). Now I have a need to add a new field, but it needs to keep a certain formatting. I've added it to the database as rich text. It saves correctly (I can see the value in the field and the bold/regular and fonts are correct. However, when I merge it displays html code (<div><font face=Arial size=2 color=black><strong>  etc...).

Is there any way for me to import the format?
LVL 18
CluskittAsked:
Who is Participating?
 
CluskittConnect With a Mentor Author Commented:
It seems that there are no more ideas. If I have no further suggestions till the end of the week, I'm going to close this question. I will have to use VBA to search for keywords and embolden them one by one.
0
 
Jeffrey CoachmanMIS LiasonCommented:
First, Technically, Rich text and HTML are two different formats.

Microsoft Access 2007 and newer, calls it "Rich Text", when it is actually HTML.

The last time I researched this, there was no easy way to do what your are asking.

In other words, your system is trying to "Insert" HTML (with the formatting codes/tags) into the Rich text (actually HTML) field directly.

You cannot (as far as I know) Insert Raw HTML codes into a memo field and have it "display" formatted.
The purpose of a Rich text field in Access was to allow you to format the data once it is "in" Access.

JeffCoachman

0
 
CluskittAuthor Commented:
Yes, I am aware that access saves this as HTML instead of pure rich text. However, I really need to keep different text formats. Are there any workaround? Like converting functions, either on word or access? Field formatting? Sending the field into a query, change it somehow to rich text and use that?

In short, is there _ANY_ way at all I can use a merge field that uses different text formats? Basically, it's just some words are bold and others aren't. However, they are kinda dynamic and I can't predict which and how many they are (else I would just make them bold afterwards).
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Jeffrey CoachmanMIS LiasonCommented:
Not that I know of...
Perhaps there is something in Access 2010...?, perhaps someone here has addressed this issue in another Q?, ...perhaps there is a workarond using the webbrowser control...?

Can you explain a bit more about this "merge" you are doing?

Remember MS Access RichText (HTML) was only meant as a way for you to format plain text already in the data.

In the even larger sense, the question of whether or not "Formatted" data need be stored in a database at all is another discussion.

If the data needs to be "Formatted", then why not format it in the *output* (a Report).
Or in the Display (a Form).
...Or, ...if this data will be eventually "Merged into Docx files, then create a template to format it in Word.

JeffCoachman
0
 
CluskittAuthor Commented:
Ok, let's try to break it down:

We work with many different companies. One of the things we do is generate the paperwork when someone is hired. Now, many of these companies are part of a group. Therefore, the contract has to have text that varies from company to company:

FIRST: Company Name 1, some legal text
SECOND: Company Name 2, some legal text
etc...

Some have 3, others 4, 6, etc... This text (from first to however many there are) is stored in an access field. It is then sent to word via merge.

If this was all there was to it, there would be no problem. Right now, the merge is working correctly. But we want the "FIRST:", "SECOND:", etc, parts to be bold. That's why I want to merge rich text/html or some other alternative.
Now, if all companies had the same number all the time, it would be easy. After merging, I would just go to the top, search those and make them bold. I don't like Word VBA, but this would be easy. However, seeing as they keep changing, I can't do that (else I might chance things from other clauses).

Hope that clarified things, at least in part. If further clarifications are required, let me know.
0
 
Jeffrey CoachmanMIS LiasonCommented:
You might want to investigate doing this with a true Rich Text (rtf) control

http://www.lebans.com/richtext.htm
0
 
CluskittAuthor Commented:
That appears to be a control for enabling RTF properties on access. From what I've seen, I don't think it will allow me to pass those RTF properties into a word merge field.
0
 
Jeffrey CoachmanMIS LiasonCommented:
OK,

Then I am out of ideas...

You might want to do a search ere for keywords:
Access 2007 Insert RTF HTML Rich Text formatting

And see if another post addresses this issue.

Sorry I could not help more.

JeffCoachman
0
 
CluskittAuthor Commented:
Well, from my somewhat extensive net search, it's not an easy issue, though it's also not a common one. I might have to change my code to fix this, instead of relying solely on merge. If it were possible to send RTF to word, though, or have word understand the html that access sends it, that would make my life much easier.
0
 
CluskittAuthor Commented:
Well, seeing as there are no more ideas, I will have to move on to VBA instead. Thanks for your suggestions.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.