VBA code to wrap text?

G

grouth

I didn't find a search on this forum. Hope I'm not asking something
that has already been addressed here.

Is there a way using vba to set some or all of the columns to
automatically wrap text, similar to the Excel functionality? I was
shocked at Microsoft's suggestion to do it one row at a time. There
are hundreds of tasks already in my project.

While I'm asking the question, is there also a way to word wrap the
memo field, or does it word wrap when printing already?

Thank you.

glr
 
J

John

grouth said:
I didn't find a search on this forum. Hope I'm not asking something
that has already been addressed here.

Is there a way using vba to set some or all of the columns to
automatically wrap text, similar to the Excel functionality? I was
shocked at Microsoft's suggestion to do it one row at a time. There
are hundreds of tasks already in my project.

While I'm asking the question, is there also a way to word wrap the
memo field, or does it word wrap when printing already?

Thank you.

glr

grouth,
First of all you have posted to a newsgroup that is destined to be shut
down so it isn't necessarily monitored on a regular basis. In the future
please post Project VBA questions on:
microsoft.public.project.developer

To answer your question, yes, but keep in mind that Project only wraps
fields that contain a space in the text string. Also be advised that
Project does not call it "text wrap", rather Project works with row
height. So even though it could be done with VBA is it really worth it
to write code just for that?

With regard to your second question, by "memo" field I assume you mean
the Notes field. The only real way to get the Notes field to print fully
is to use File/Page Setup/View tab and set the option to print notes. If
you try to print out the Notes field as a column in a view, the text
will be truncated at either the first line feed or 256 characters,
whichever occurs first. Of course you can always use VBA to export the
Notes field to another application (e.g. Excel) where they can be
printed. As it turns out I have a couple of macros that do just that. If
you are interested, contact me directly.

John
Project MVP
jensenj6atatcomcastdotdotnet
(remove obvious redundancies)
 
R

Renu Ramesh

Try using
Worksheet.Cells.WrapText =true
to wrap all the cells.

(Hope this works!!!)

Regards,
Ren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top