Office 2003 Pro.

I am creating tables in Word and then adding text to these tables and
formatting.

Qu.1
------
This example shows 2 bits of text going into one cell. What I want to
do is then make "Title text" bold, and I end up always setting the
whole cell bold. How should I do this without using an extra row for
my title ?

Set rng = objWord.ActiveDocument.Tables(intTable).Cell(1, 1).Range
rng.Text = "Title text"
rng.Text = "Some more text"
rng.InsertAfter (strUnit)

Qu.2
------
My table has multiple rows and combination of x1 column or x2 columns:
Is it best to create all x1 column and use cell.slit or create all x2
columns and use cell.merge,... or it doesnt matter ?

Re: selecting specific text within a cell by Doug

Doug
Thu Feb 21 04:11:42 PST 2008

Use:

Set Rng = objWord.ActiveDocument.Tables(1).Cell(1, 1).Range
Rng.Text = "Title text "
Rng.Font.Bold = True
Rng.start = Rng.End - 1
Rng.Text = "Some more text"
Rng.Font.Bold = False

I would be inclined to start with 2 columns and do everything that you need
to before merging any of the cells. Once you have merged cells, operating
on a particular cell gets more difficult.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

<jbd5623@yahoo.co.uk> wrote in message
news:634bf951-c956-45f4-846d-ad5baed7a1fb@k2g2000hse.googlegroups.com...
> Office 2003 Pro.
>
> I am creating tables in Word and then adding text to these tables and
> formatting.
>
> Qu.1
> ------
> This example shows 2 bits of text going into one cell. What I want to
> do is then make "Title text" bold, and I end up always setting the
> whole cell bold. How should I do this without using an extra row for
> my title ?
>
> Set rng = objWord.ActiveDocument.Tables(intTable).Cell(1, 1).Range
> rng.Text = "Title text"
> rng.Text = "Some more text"
> rng.InsertAfter (strUnit)
>
> Qu.2
> ------
> My table has multiple rows and combination of x1 column or x2 columns:
> Is it best to create all x1 column and use cell.slit or create all x2
> columns and use cell.merge,... or it doesnt matter ?
>
>



Re: selecting specific text within a cell by jbd5623

jbd5623
Thu Feb 21 04:32:08 PST 2008

That worked just fine, thanks for your very speedy response.

I have an O'Reilly book "Writing Word Macros" by Steven Roman, and I
didnt find it bery helpful.

Can you suggest another source of information that covers the basics ?

thanks again.




Re: selecting specific text within a cell by Doug

Doug
Thu Feb 21 15:00:47 PST 2008

I don't have any books, but that one is by comments from colleagues whose
opinions I respect, one of the better ones.

My reference is the Help facility in the Visual Basic Editor. The other
places to search for answers are at http://word.mvps.org/
or in the Google Groups at
http://groups.google.com/groups/dir?sel=33606782&expand=1

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

<jbd5623@yahoo.co.uk> wrote in message
news:9eed7eb6-c935-4413-b04e-074d7b81e6c6@n75g2000hsh.googlegroups.com...
> That worked just fine, thanks for your very speedy response.
>
> I have an O'Reilly book "Writing Word Macros" by Steven Roman, and I
> didnt find it bery helpful.
>
> Can you suggest another source of information that covers the basics ?
>
> thanks again.
>
>
>