Handling special formatting characters in MS Access .i.e. crlf

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I regularly need to import data containing crlf characters and sometimes
formatting and colors.

MS Access truncates these.

I have tried to circumvent the issue by using repacement characters for the
crlf and using a function to rebuild the string.

It works within the Function (proven via Debug.print), but does NOT return
the special characters AFTER the replacement rebuilding.
 
What kind of file are you trying to import and what method are you using to
import it? More Detail = Better Answer
 
1) MS Word:
1a) Convert line breaks to a literal "@CRLF#"
1b) Convert *.doc to *.txt

2) MS Access:
2a) File, Get External Data, (TXT file)
2b) I then use MS VBA to replace the literal to "vbcrlf"

If there is some other way, I would apprciate knowing it.

-----------------
 
Sorry, ThorburnL, I have not really worked with the Word object model, so I
don't think I can help.
 
Basically there are only two ways of importing text files that include
line breaks within the data (as opposed to between records). One is to
do what you've been doing: replace the line breaks with something else
before importing, and restore them afterwards. The other is to get the
text file into the standard CSV format, which for Office means:

-Carriage return + line feed between records
-Comma between fields
-Any text field may be enclosed in quote marks " "
-Any text field that contains a comma, or a line break
must be enclosed in quote marks
-Any quote marks in quoted fields must be doubled.

E.g.

112,"Peter","Jones","Sloane Square","London"<CRLF record separator>
123,"James ""Big Jim""","Smith","23 Railway Parade,<CRLF line break>
Oxford Road","Girthstead"<CRLF record separator>

Depending on what's in your Word documents, it may only take a few
Replace operations and maybe a Convert Table to Text to manipulate the
data into CSV format.
 
Back
Top