printing >> xl 97 TxBox property - WordWrap

by ZGlwaXRpZHVkYQ » Thu, 06 Jan 2005 07:05:03 GMT

I'm running Windows 98, XL97 for a workbook with password protection at VBA
ThisWorkbook level. I have a text box contol embedded in a cell with max row
height on cell set at 409. Text box format control is set to 'move and size
with cells' and PrintObject = True. Properties for text box are also set to
True for: EnterKeyBehavior, MultiLine, TabKeyBehavior, and WordWrap; False
for: ScrollBarsBoth, AutoSize, DragBehavior, and SelectionMargin.

The problem is that when a user types text into the control and selects
PrintPreview or actually prints the document, the data within the text box
(if more than one line of text) does not wrap around properly. Some of the
text wraps, but cuts off other text that should have wrapped, as well. Also,
when the text box control = GotFocus, the text appears visually as it should
look on PrintPreview or on Print command.

I have tried every combination for the text box control available. I truly
am at a loss here! Is this something that has to be handled in VBA? Thanks.

Please help!

Similar Threads

1. XL 97 Text Box property - WordWrap - Excel

2. XL 03 vs XL 97

3. VBA - Writing in XL XP, executing in XL 97 - Excel

4. problems with XL 2000 files in XL 97

Hi,

I designed a spreadsheet with a user form & code in Excel 2000 and then 
opened the files in Excel 97, however although the spreadsheet was visible, 
the VBA project was unviewable.  I went back into Excel 2000 and removed the 
project protection and saved the file in Excel 97 format but the project is 
still unviewable in Excel 97.

Any ideas?

Rob

5. Making XL 2002 Macro Backwarly compatible with Xl 97

6. InsertFile - XL - Fails with wd2k, OK in '97 - Never Mind :-)

Found it.
Tried inserting manually and (lo and behold!) got an error message that
told me I didn't have a feature installed (assuming it was a converter,
though you'd think an Office product would automatically install
whatever's necessary to talk to other Office products (God knows MS has
installed a lot of stuff I didn't want(!)).
Anyway, popped in the CD and all is well.

-- 
Regards;
Rob
------------------------------------------------------------------------
"RWN" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Wd97/NT4 & 2k/Win2kPro
>
> Selection.InsertFile FileName:=PSDir & PSName, Range:="", _
>         ConfirmConversions:=True, Link:=False, Attachment:=False
>
> Wd97 - Works fine
> Wd2k - with ConfirmConversions=False Inserts as text
>  Made Confirm True and, sure enough, it thinks it's a text file.
> Selected XL and the "Command Failed".
>
> Also (perhaps trying to tell me something);
> When running under '97 it would pop up a box to allow "Whole Workbook"
> (setting the range to a sheet & cell range would kill that).
> Doesn't do this in 2k.
>
> File opens fine in XL, directly or from an icon (therefore association
> is ok(?)).
>
> Is this a version difference or do I have a bigger problem (besides
> being NTB!).
>
> -- 
> Regards;
> Rob
> ----------------------------------------------------------------------

7. InsertFile - XL - Fails with wd2k, OK in '97 - Word VBA

8. TextBox WordWrap and Lines Property

Hi All,

I mistakenly just posted this to the VB group.  Sorry for the
cross-post.

I am working with a textbox in C# which pulls a set of lines (stored in
the database as text_type, text_line_seq, text_desc).  I am using three
text boxes to display previously entered text for selected users
(surgeons) to edit.  Each type of line has a specific maximum length
(55,56, and 74 characters).  The textbox must allow the users to format
their text (see EXAMPLE TEXT below) pretty much with just spacing.

I have the textbox properties set to multiline edit and I am appending
"\r\n" to each line as I pull it from the database and put it in the
textbox.

My problem is when a user typically adds a substantial amount of text
wordwrap will push "\r\n" down to the next line.  When saving back to
the database I am using a foreach(string Line in Lines) to save the
data and the result is that the line runs over the maximum length
allowed for the line.

Ideally, I simply would like to insert Environment.Newline wherever
there is a wordwrap.  I have been trying to use EM_FMTLINES (see
EM_FORMATLINES EXAMPLE) , but it has not worked so far.     I am not
sure where I should call the method (SendMessage) and exactly whether
this will result in what I require.

I keep telling myself I must be making this more difficult than it
needs to be, but the solution has not appeared obvious so far.

Thanks for any suggestions.

Mike


EM_FORMATLINES EXAMPLE:

public static extern int SendMessage(IntPtr hWnd,int Msg,int
wParam,int lParam);

public const int EM_FMTLINES = 200;

SendMessage(tbxDiagnosis.Handle, EM_FMTLINES, 0, new IntPtr(0));

EXAMPLE TEXT:

NOTE:  This procedure was done at the Hospital, in conjunction
with the Otolaryngology Service and Plastic Surgery.  This patient is
having a free jejunal graft for replacement of his cervical esophagus,
and
the other parts of the procedure were performed by Dr. X and Dr.
Y.
ANESTHESIA:  General endotracheal
ESTIMATED BLOOD LOSS:  Less than 20 cc
DESCRIPTION OF PROCEDURE:  Under satisfactory general anesthesia, after