selecting specific text within a cell

J

jbd5623

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
 
D

Doug Robbins - Word MVP

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
 
J

jbd5623

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.
 
D

Doug Robbins - Word MVP

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
 

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