VBA for word 
Author Message
 VBA for word

Hi Sachin,

To get the number of columns in the first table in the document, use

ActiveDocument.Tables(1).Columns.Count

The following will tell you if there is more than one font used in a
paragraph or the name of the font if there is only one

If Selection.Paragraphs(1).Range.Font.Name = "" Then
    MsgBox "There is more than one font used in the paragraph."
Else
    MsgBox "The " & Selection.Paragraphs(1).Range.Font.Name & " font is used
in the paragraph."
End If

If there is more than one, it would be necessary to test the font used on
each character in the paragraph to determine the total number.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> I want to read the table in word through Visual Basic and
> count number of columns in it. I also want to know number
> font used in each paragraph through code.Please help me
> out.
> Thanks.



Sun, 01 Jan 2006 10:34:16 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Access97 VBA and Word VBA

2. Call Excel VBA from Word VBA?

3. vba problem word 97 and not word 2000

4. Differences between VBA for Word 2000 and Word 97

5. Word count differs in VBA from Word dialog box

6. Trouble with text boxes in VBA for Word.

7. Using Access VBA with Word

8. VBA and Word

9. dbList controls in VBA for Word

10. VBA and Word

11. VBA Access-WORD

12. VBA crashes Word on multi-column listbox

 

 
Powered by phpBB® Forum Software