View Full Version : Line Breaks and Squares
nysports
12-06-2011, 09:49 AM
Hi all. I've speant hours trying to find an actual answer to this question. I'm using VB in Word and have inserted a version of the following code into a form box:
ComboBox1.List() = Array("Company" & vbLf & "address", "One", "Two", "Three")
When I click on the entry box in my document though, and select the first option, I get two lines like I want, but a square character in front of the second line. I've tried replacing vblf with Char(10), Char(13), and various other VB's. Any thoughts?
gmaxey
12-06-2011, 11:01 AM
Is this "square" the non-printing character that indicates a type of paragraph formating?
Tinbendr
12-06-2011, 01:58 PM
I've had this problem over the years, but never really found a solution.
I know if I start my document over from scratch (no code), the box disappears for a little while.
Sorry, I can't be of more help.
Paul_Hossler
12-07-2011, 08:09 AM
Any thoughts?
1. Might be the font. Try different fonts, and making sure that the same font is use
The ChrB function is used with byte data contained in a String. Instead of returning a character, which may be one or two bytes, ChrB always returns a single byte. The ChrW function returns a String containing the Unicode (http://vbaexpress.com/forum/ms-help://MS.WINWORD.DEV.12.1033/WINWORD.DEV/content/HV01200929.htm) character except on platforms where Unicode is not supported, in which case, the behavior is identical to the Chr function.
2. Try ChrB or ChrW and see if it helps, instead of 'plain' Chr()
3. Good luck :dunno
Paul
nysports
12-08-2011, 07:38 AM
First off, thank you all for the help. So far, no luck though. Here are the updates based on your suggestions:
Q. Is this "square" the non-printing character that indicates a type of paragraph formating?
A. No, it definitely prints.
Q. Is it a font?
A. No, tried multiple fonts; same result
Q. Try ChrB or ChrW and see if it helps, instead of 'plain' Chr()
A. When I do this I get "Compile Error Argument Not Optional"
What's interesting is that in the form box, the little paragraph symbols show up in the choice.
I think the square thingee is called a pilcrow. Here's a thread that might help. Dave
http://www.vbaexpress.com/forum/showthread.php?t=36710&highlight=square
edit: Perhaps the TRIM function might also be useful?
nysports
12-12-2011, 08:35 AM
Good looking out, it's a little over my head though. What part would be relevant to my problem?
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.