Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rich text box in forms | Excel Discussion (Misc queries) | |||
Rich Text Boxes | Excel Worksheet Functions | |||
Copnvert dates reading as Text to a date format | Excel Discussion (Misc queries) | |||
Working with Rich Text Format | Excel Programming | |||
Rich Text Box | Excel Programming |