Set the font of all words in tables to Times New Roman

C

Chongchong

I have a Word document with many tables in it.

I want to set the font of all the words in the tables within an area that I
select to Times New Roman.

I wrote the following code, but it does not work:

For each oTable in Selection.Tables
oTable.Font.Name = "Times New Roman"
Next

What's wrong with the code that I wrote?
 
M

macropod

Hi Chongchong,

'.Font' is not a property of the table object. Try:

For Each oTable In Selection.Tables
oTable.Range.Font.Name = "Times New Roman"
Next
 
C

Chongchong

macropod,

Thank you. It works. :)

macropod said:
Hi Chongchong,

'.Font' is not a property of the table object. Try:

For Each oTable In Selection.Tables
oTable.Range.Font.Name = "Times New Roman"
Next

--
Cheers
macropod
[Microsoft MVP - Word]


Chongchong said:
I have a Word document with many tables in it.

I want to set the font of all the words in the tables within an area that I
select to Times New Roman.

I wrote the following code, but it does not work:

For each oTable in Selection.Tables
oTable.Font.Name = "Times New Roman"
Next

What's wrong with the code that I wrote?
.
 

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