PDA

View Full Version : Solved: Simple word table question



ukemike
05-09-2005, 10:07 AM
Hey guys,

MOS MASTER thanks for your help on the last post.
I need to have a 'box' in my word document which will have certain words to search for. Than my program does a find/replace for those items.
The thing is, each one of my table cells need to the same height as they started. Basicallly if they're height is 2 inches when after i do a find/replace and add some text into there the height needs to stay the same.
I know it must be one of the properties when you are creating a table, just cant figure out which one.
I was using textboxes but the code to search through textboxes is too long and also does not work 100 percent of the time.


Thanks guys
Mike

MOS MASTER
05-09-2005, 10:15 AM
Hi Mike, :D

Your welcome. Could please mark your previous thread solved so others know it's working for you?

For your table you only have to go to the tableproperties and then to the Row tab and set al sizes to exact (Dropdown box)

If needed do the same for your columns..

Enjoy! :whistle:

ukemike
05-09-2005, 11:59 AM
MOS,

One more quick question for you. I've been looking on how to this for a couple of hours.

Basically I got a string "firstline /n second line /n third line".
I am doing a find/replace, but i need Word to recognize those /n as line breaks.

Im going through a loop and doing.

Selection.Find.Replacement.Text += brokenString[a].ToString();
Selection.InsertBreak(ref lineBreak)
Im doing this in C#. Basically i break the string by the '/n' character, into an array then i loop through the array and concatenate item after item into the Selection.Find.Replacement.Text. But between those items i am trying to
Selection.InsertBreak=6.

It get all screwed up. What is the VBA code to loop through a array and add one line, one linebreak, one line, one linebreak.

Thank you very much again.
This project is sooooo behind.!! :motz2:

Mike

MOS MASTER
05-09-2005, 12:12 PM
Hi Mike, :d

Have a baby on my hand that should be sleeping by now....(so I'll keep it short)

Use the Chr$() function for your concanation.

Use Chr$(11) to get a linebreak in you're string and use Chr$(13) to replace your /n

Then pass you're string to the Find sub as replacement.

Enjoy! :whistle:

MOS MASTER
05-10-2005, 02:34 PM
Hi Mike, :D

Glad to see you've got this one working as well! :thumb
(More cave-at's to come in you're project?)