Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Removing leading spaces /tabs from text removed from a word document and put into a rich  textbox on a form

Posted on 2011-03-14
9
Medium Priority
?
635 Views
Last Modified: 2012-05-11
we have vb net 2008 crystal report 11 sql 2005
I am having a user put text into a rich text box on a form /cut and paste
I am taking that text and saving it to a table and printing it out on a letter in crystal reports.
My problem some of the code pasted in has a few tab fields or spaces between the beginning and the first letter.
I want to remove leading spaces or tabs.  Does anyone know now to identify them and removed them within a form.

This text
This had spaces leading the text.

                            You did not sign your application. As stated in the current application packet, the application “[m]ust be signed and dated or the application will be returned as incomplete.”
Is rtf is
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 CG Omega;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\li720\lang1033\f0\fs22 You did not sign your application. As stated in the current application packet, the application \ldblquote [m]ust be signed and dated or the application will be returned as incomplete.\rdblquote\par
\pard\f1\fs17\par



Regular text no leading spaces or tabs



You provided an Employer Work Experience Statement that does not include the name of the candidate. As stated in the current application packet, “[t]his form must be completed and included in the application by at least one of your current/former dentists.”

rtf
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 CG Omega;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1\pard\f0\fs22 You provided an \i Employer Work Experience Statement \i0 that does not include the name of the candidate. As stated in the current application packet, \ldblquote\cf1\fs16 [t]his form \ul must \ulnone be completed and included in the application by at least one of your current/former dentists.\rdblquote\cf0\fs22\par
\f1\fs17\par
}

0
Comment
Question by:john M
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
9 Comments
 
LVL 41

Assisted Solution

by:graye
graye earned 1000 total points
ID: 35132731
There's a good VB6 example at this website:  http://bytes.com/topic/visual-basic-net/answers/387438-white-space-string

You can accomplish the same kind of thing with VB.Net using the String.Trim method
http://msdn.microsoft.com/en-us/library/t97s7bs3.aspx
0
 
LVL 3

Author Comment

by:john M
ID: 35140683
trim did not work - i don't think they are white spaces. It is more like the identing word does itself.
when you start typeing with the old word you saw a ruler up on top.

Thanks
0
 
LVL 41

Expert Comment

by:graye
ID: 35141520
Wow... you lost me on that last comment.

So, if you still need to remove "white space" (to include space, tab, line feed, carriage return) from a string, the Trim() method will indeed to that.  The VB6 example above shows specifically how.  I didn't include a link to the VB.Net version of String.Trim, since it operatates almost the same way.

On the other hand, if I completely missed the point (and it's certainly looking that way), then tell us again what the question is.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 3

Author Comment

by:john M
ID: 35142106
Please read the document attacted
thanks
ee1.docx
0
 
LVL 3

Author Comment

by:john M
ID: 35160279
Update

What i was wanted was in the rtf code that is in my table I was hoping to find out if there was a control for indenting. I did find thats if the when you indent the   \li123 is the control that shows that.
what i was hopeing was to find the best way not to let something be indented



{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 CG Omega;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\li000\lang1033\f0\fs22 You did not sign your application. As stated in the current application packet, the application \ldblquote [m]ust be signed and dated or the application will be returned as incomplete.\rdblquote\par
\pard\f1\fs17\par
}
0
 
LVL 46

Accepted Solution

by:
aikimark earned 1000 total points
ID: 35161014
you have correctly identified the RTF tag.  \li### is the left indent tag.

there is also a first line (of the paragraph) indent and a right indent

http://www.biblioscape.com/rtf15_spec.htm

Back in the mid 90s, I chose RTF as the format of a document that my application created.  It wasn't easy, since Word, WordPad, and WordPerfect all implemented RTF a little differently.  The link also has a section for Word-specific RTF tags (\pn____).
0
 
LVL 3

Author Comment

by:john M
ID: 35166915
Aikimark

Is there a way to put  like word or another spell checker to spell check a rich text box?
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35167286
There are third-party controls and at least one open-source spell checker.  If you want to use Word, you will need to use ActiveX automation (creating a Word.Automation object), inserting the raw text and then invoking Word's spell checker.  For performance sake, you would probably want to create the Word object only once for the program.

You might want to look at a VSTO implementation.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question