![]() |
#6
|
||||
|
||||
![]()
I am making progress, but have run into a couple of puzzling results.
I wanted to use this same syntax to change the font and the borders. I started by capturing the code using the recorder. This is what I got: Code:
Sub Macro1() Selection.Font.Name = "Calibri" Selection.Borders(wdBorderTop).LineStyle = wdLineStyleNone Selection.Borders(wdBorderLeft).LineStyle = wdLineStyleNone Selection.Borders(wdBorderBottom).LineStyle = wdLineStyleNone Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone Selection.Borders(wdBorderVertical).LineStyle = wdLineStyleNone Selection.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone Selection.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone End Sub For the font change line, I got a Compile error: "Methor or data member not found". For the last two lines of the border settings, I got a Runtime error '5941': "The requested member of the collection does not exist". These lines are shown in red and commented out. Code:
With Selection.Tables(1) .Rows.AllowBreakAcrossPages = False .AllowAutoFit = False .Rows(1).HeadingFormat = SettingHeaderRow ' .Font.Name = "Calibri" If SettingHeaderBorderOff Then 'Turn all but bottom border off With Selection.Tables(1).Rows(1) .Borders(wdBorderTop).LineStyle = wdLineStyleNone .Borders(wdBorderLeft).LineStyle = wdLineStyleNone .Borders(wdBorderRight).LineStyle = wdLineStyleNone .Borders(wdBorderVertical).LineStyle = wdLineStyleNone ' .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone ' .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone End With End If End With |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
KIM SOLIS | Excel | 2 | 11-04-2011 06:09 PM |
![]() |
RBusiness | Word | 1 | 06-07-2011 04:26 PM |
![]() |
b0x4it | Word VBA | 2 | 05-26-2011 06:25 AM |
Table - Check Boxes - Create Select All | lajohn1963 | Word Tables | 2 | 09-25-2010 11:18 AM |
![]() |
Styler001 | Word | 4 | 01-25-2010 06:40 PM |