Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Reading Wordpad - Rich Text Format

Hey Guys

I need to read a Worpad format in Excel.

I depend on a wordpad app to input text to a SQL database. I then read the
text field from the DB via ADO into Excel using nvarchar for the text field
as this is RTF. The text I get back looks like the following:

================================================== ===================
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil MS Sans
Serif;}{\f1\fnil\fcharset0 MS Sans Serif;}{\f2\fswiss\fprq2\fcharset0 Arial;}}

{\colortbl ;\red0\green0\blue0;}

\viewkind4\uc1\pard\cf1\lang1033\f0\fs20 SPOKE RIETTE AND INFORMED HER THAT
CALLS WERE LOGGED INCORRECTLY I GAVE HER A NUMBER TO HELP HER OUT


\par

\par THE PRINTER IS FAULTY

\par \f1 called and confirmed with the user that the call can be closed.

\par \f2\fs18

\par }
================================================== ===================

All I want is the actual text:

================================================== ===================
SPOKE RIETTE AND INFORMED HER THAT CALLS WERE LOGGED INCORRECTLY I GAVE HER
A NUMBER TO HELP HER OUT

THE PRINTER IS FAULTY
called and confirmed with the user that the call can be closed.

================================================== ===================

I know its a long shot but is there any way I can format the field within
Excel to read Rich Text Format?

Please help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Reading Wordpad - Rich Text Format

All I want is the actual text:

One way to achieve this is to put a RichTextBox control on a userform.

Read your WordPad document as follows:

userform1.RichTextBox1.FileName= "C:\Document.rtf"


Get the text only from the control as follows:

RTFText = userform1.RichTextBox1.text


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Reading Wordpad - Rich Text Format

Hi AA2e72E

I use a ADO recordset to import the date from SQL and do not go through
every record as it's alot of data. The code I currently use to dump the
recordset in Excel is: Range("A2").CopyFromRecordset rstRecordSet

I also clear the worksheet before import: ActiveSheet.Cells.Clear

I might be able to use you suggestion if I used a "Do untill EOF" and edited
one record at a time but this will slow my query down to much.

Any other ideas?


"AA2e72E" wrote:

All I want is the actual text:


One way to achieve this is to put a RichTextBox control on a userform.

Read your WordPad document as follows:

userform1.RichTextBox1.FileName= "C:\Document.rtf"


Get the text only from the control as follows:

RTFText = userform1.RichTextBox1.text


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rich text box in forms ed.ayers315 Excel Discussion (Misc queries) 0 January 20th 10 02:33 PM
Rich Text Boxes SueDot Excel Worksheet Functions 2 May 18th 09 05:00 PM
Copnvert dates reading as Text to a date format Margy Excel Discussion (Misc queries) 5 February 9th 09 06:53 PM
Working with Rich Text Format Robert Mulroney[_3_] Excel Programming 5 October 13th 05 12:30 AM
Rich Text Box Randall[_5_] Excel Programming 0 April 30th 05 05:56 PM


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"