MS query

B

Bob L.

I'm bringing over data into Excel using MS Query from
another application. One of the fields is a "Note"
field. This field comes over including all the
formatting.
(i.e. "{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0
\fnil\fcharset0 Arial;}{\f1\fnil MS Sans Serif;}}
\viewkind4\uc1\pard\lang1033\fs16 Again I say this is just
a test.\f1\par
})
The technical people at the other application say:

"The notes fields are now Info Power Rich Text fields.
You will need to use components that reflect them as Rich
Text fields. You are apparently using a component that
sees the field as a plain text memo field. Therefore, the
font formatting is not hidden and shows up. Using a Rich
Text component will cause it to display correctly."

I've looked at formatting the cell and field in both MS
Query and Excel but cannot correct the problem. Any
ideas? Any help would be greatly appreciated!
 
H

Harald Staff

Hi

Rich text (.rtf) is similar to Html, it includes formatting tags and need a dedicated
"thing" (in the computer world that's a "component") that can understand and display it.
For Html it's a browser component, for Rich text it's usually a "rich text box" as found
in Word, Wordpad and as raw material in Visual Studio. Excel cells can not do this, so
rich text data in a cell is nonsense. I think your choices are either to have a macro
strip away all rich text tags (a horribly big task), or to find an implement a component
to display this (a horribly big task) or to ignore the Note field alltogether and enjoy a
chilled beer instead. Your boss might of course not agree with my preferences here.

I have searched a while for VB/VBA code to strip away rtf formatting and return plain
text, but found nothing. But spend an hour doing so, you might be luckier.
 
Top