By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,143 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,143 IT Pros & Developers. It's quick & easy.

removing non traditional text

P: n/a
This is really weird.

I have provided to a client a means for which they can store text in a
database and insert into a word document.

Originally they entered the text into a textbox. However when they copied
and pasted text in there apparently formatting symbols came over as well but
they were not visible. So when they searched for this text in the document
after inserting it the "find" function didnt work.

So I came up with the idea of putting it in a rich textbox. This for the
most preserved the formatting in a visible form. They entered it into the
database. Then they would open it in a regular textbox and remove all I can
call appear to be style markings of some kind (a square in shape).

I am wondering if there is a way to automate the removal of this unorthodox
text.

Thank you all for your help!!
Nov 20 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Hi Scorp,

Is it always that symbol and does it always appear as the first character?
If either is true, you could look for it on the update to the row in sql and
weed it out, looking for that particular ascii equivalent (sounds like ascii
254 ?).

HTH,

Bernie Yaeger

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:u%****************@TK2MSFTNGP09.phx.gbl...
This is really weird.

I have provided to a client a means for which they can store text in a
database and insert into a word document.

Originally they entered the text into a textbox. However when they copied
and pasted text in there apparently formatting symbols came over as well but they were not visible. So when they searched for this text in the document
after inserting it the "find" function didnt work.

So I came up with the idea of putting it in a rich textbox. This for the
most preserved the formatting in a visible form. They entered it into the
database. Then they would open it in a regular textbox and remove all I can call appear to be style markings of some kind (a square in shape).

I am wondering if there is a way to automate the removal of this unorthodox text.

Thank you all for your help!!

Nov 20 '05 #2

P: n/a
> Is it always that symbol and does it always appear as the first character?

Hi Berine

It is this synbol I have attached in a text file. For some reason I cannot
paste it here.

It seems to occur whenever a format change occurs in the text or a break in
the text occurs.

When I try to do a Trim statement in visual studio when I click paste it is
invisible and breaks to the next line.

Is anything able to handle this character?


Nov 20 '05 #3

P: n/a
Hi Scorp,

It's weird all right. I remember - a long time ago - converting data from a
Borland Paradox system (I told you it was long ago!) to a foxpro system and
I ran into the same character. It's something like an end of line
character, because you can't get behind it, except with one of itself, and I
was able to rip it out, but I don't recall how I did it. I may have parsed
the line and disallowed anything that wasn't alphanumeric or chr(10) and
chr(13) and dashes, etc, but I honestly do not recall.

Sorry I couldn't be of more help.

Bernie

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Is it always that symbol and does it always appear as the first
character?
Hi Berine

It is this synbol I have attached in a text file. For some reason I cannot
paste it here.

It seems to occur whenever a format change occurs in the text or a break in the text occurs.

When I try to do a Trim statement in visual studio when I click paste it is invisible and breaks to the next line.

Is anything able to handle this character?


Nov 20 '05 #4

P: n/a
It's something like an end of line
character, because you can't get behind it, except with one of itself, and I was able to rip it out, but I don't recall how I did it.


Bernie,
Thanks for trying. I am hoping someone else has ideas.
Nov 20 '05 #5

P: n/a
see this link
http://personalwebs.oakland.edu/~gro...cii.codes.html

it seems to post ASCII codes for characters that look like mine.

How would I code tell it to remove all ASCII codes that I choose from this
page
Nov 20 '05 #6

P: n/a
Hi Scorp,

I looked at the page you refer to. It's odd but when I try to create
characters with the codes represented there, I get different characters.

In any case, here's an example of parsing a string to remove certain
characters. This example removes Z (chr(90)) from anywhere in the string in
a textbox and places the result into another textbox. I used the first
string's leave event for this, but any event will do.
glf_parsedstring = rawstring.Text

Dim i As Integer

For i = 1 To glf_parsedstring.length

If InStr(Mid(glf_parsedstring, 1, i), Chr(90)) Then

glf_parsedstring = Mid(glf_parsedstring, 1, i - 1) & Mid(glf_parsedstring, i
+ 1)

End If

i += 1

Next

parsedstring.Text = glf_parsedstring

HTH,

Bernie

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:Os**************@TK2MSFTNGP09.phx.gbl...
see this link
http://personalwebs.oakland.edu/~gro...cii.codes.html

it seems to post ASCII codes for characters that look like mine.

How would I code tell it to remove all ASCII codes that I choose from this
page

Nov 20 '05 #7

P: n/a
when they copied
and pasted text in there apparently formatting symbols came over as well but they were not visible. So when they searched for this text in the document
after inserting it the "find" function didnt work.


I have solved this issue. There is no need to respond to this thread.
Nov 20 '05 #8

P: n/a
Hi Scorp,

Just curious - how'd you solve it?

Bernie

"scorpion53061" <Its the end of the world as we know it@here.com> wrote in
message news:%2***************@TK2MSFTNGP12.phx.gbl...
when they copied
and pasted text in there apparently formatting symbols came over as well

but
they were not visible. So when they searched for this text in the document after inserting it the "find" function didnt work.


I have solved this issue. There is no need to respond to this thread.

Nov 20 '05 #9

P: n/a
> Just curious - how'd you solve it?

You are not going to believe this........

TextBox4.Text = Replace(RichTextBox1.Text, Chr(10), "")

I cannot believe I struggled so hard with this.
Nov 20 '05 #10

P: n/a
Cor
Still that strange CSV file without a "CR" Scorpion, I never heard if you
did succeed with that sample I have made.

I made it in C# also and thouhgt sending it when you was asking that
question in the C# newsgroup, but did not.

:-))

Cor

TextBox4.Text = Replace(RichTextBox1.Text, Chr(10), "")

Nov 20 '05 #11

P: n/a
> Still that strange CSV file without a "CR" Scorpion, I never heard if you
did succeed with that sample I have made.


Could you remind me of the sample of which you speak?

The dataset to array to MS Word table code is still not working. I am
getting HResults errors all over the place.

I am SO frustrated by this.

Have you ever done this before?
Nov 20 '05 #12

P: n/a
Cor
Hi Scorpion,

I see this now, I thought Cindy, me and others where talking about Excel all
the time, paste here in and example of the resultfile you want, than I can
look to it, but no interop with Word, that I did not do a long time, just a
kind of txt format.

Or if you want I can make it in HTML as a table, that is no problem for me
at all and that you can read in Word as a table.

Cor

Could you remind me of the sample of which you speak?

The dataset to array to MS Word table code is still not working. I am
getting HResults errors all over the place.

I am SO frustrated by this.

Have you ever done this before?

Nov 20 '05 #13

P: n/a
Hi Cor,

Right it was a Word table.

We are trying to use the Word automation object model to write an array
(created from a dataset) to a word table.

I can write it cell by cell but it is painfully slow.

I can also write it via a html within the vb.net app but I have found it
difficult to make a professional looking report this way.
"Cor" <no*@non.com> wrote in message
news:e3*************@TK2MSFTNGP12.phx.gbl...
Hi Scorpion,

I see this now, I thought Cindy, me and others where talking about Excel all the time, paste here in and example of the resultfile you want, than I can look to it, but no interop with Word, that I did not do a long time, just a kind of txt format.

Or if you want I can make it in HTML as a table, that is no problem for me
at all and that you can read in Word as a table.

Cor

Could you remind me of the sample of which you speak?

The dataset to array to MS Word table code is still not working. I am
getting HResults errors all over the place.

I am SO frustrated by this.

Have you ever done this before?


Nov 20 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.