![]() |
#1
|
|||
|
|||
![]()
Does anyone know how to get rid of those odd looking rectangular-squarish characters in text strings?
On active layer I have paragraph text that I wish to process using vb string functions. But, when I do something like: Dim sTemp As String sTemp = s.Text.Story.Characters.All sTemp is fill with a string of printing and non-printing characters represented by "[]" rectangles. I assume they're printing instructions (new line, new paragraph, spacing) and I need to convert string to ASCII, but I don't know how to get that done. Thanks p.s. What an awesome forum! Last edited by Beatniks; 21-04-2007 at 16:04. |
#2
|
||||
|
||||
![]()
I would replace formatting codes by builtin VBA 'replace' function
Code:
s=Shape1.Text.Story.Text s=replace(s,vbCr," ") s=replace(s,vbLf, " ") s=replace(s,chr(11), " ") 'softreturn '.......or in one line: s=replace(replace(replace(Shape1.Text.Story.Text,vbCr," "),vbLf, " "),chr(11), " ") |
#3
|
|||
|
|||
![]()
Thank You!
|
#4
|
|||
|
|||
![]()
The code above removed most characters, but there was still a few that needed to be identified before I could get rid of them. The following code accomplished that:
sBadCharacter = Mid(st, 27, 1) ' This gets the twenty-seventh character, which was the bugger! sBadCharacterNumber = Asc(sBadCharacter) ' This tell me the character number Now, put this in the removal lines... st = Replace(st, Chr(sBadCharacterNumber), " ") or st = Replace(st, Chr(9), " " ) |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Striping a word down to the first letter only | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 9 | 19-04-2007 15:14 |
fading box from color to transparent | DalePurdon | General | 6 | 08-12-2006 15:47 |
Changing Colour of Characters in Artistic text | knowbodynow | CorelDRAW/Corel DESIGNER VBA | 3 | 06-05-2006 19:43 |
Text ENCODE | Craig Tucker | CorelDRAW/Corel DESIGNER VBA | 10 | 26-01-2005 13:59 |
Special Characters | Craig Tucker | CorelDRAW/Corel DESIGNER VBA | 3 | 12-03-2003 11:57 |