Thread: [Solved] Underline Inserted Text
View Single Post
 
Old 01-22-2017, 12:10 PM
jmltinc jmltinc is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Jan 2017
Posts: 9
jmltinc is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
If the table title is the paragraph immediately before each table then
Thank you. As I said the Word object model is not something I am intimately familiar with yet and am frankly confused by it. It is far more complex than Access.

Having said that, I do not quite grasp the paragraph method. When I use a paragraph to separate text from the table (Selection.TypeParagraph), I get a blank line; which I do not want. So I have:
Code:
        Selection.TypeParagraph
 
'Product Specifications
        Selection.Text = " Product Specifications"
        Selection.Font.Name = "calibri"
        Selection.Font.Size = 16
        Selection.Font.Bold = True
        'Selection.Font.Underline = wdUnderlineSingle
        Selection.EndKey Unit:=wdStory
 
        .Tables.Add Range:=Selection.Range, NumRows:=3, NumColumns:=4, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
        With .Tables(x)
Since I am not using TypeParagraph between the text and the table, I am assuming (perhaps falsely) that I haven't closed the paragraph and your code would underline the table text as well.

Obviously, I haven't tried it yet. From my tardy response to your kind advice, you can see I have been pulled in other directions at work right now. I will try your method and hopefully my thought that I haven't closed the paragraph is incorrect.

I would appreciate any explaination of the TypeParagraph method and its proper use...

Thank you,
-John
Reply With Quote