Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-29-2012, 12:29 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Please tell me it doesn't take 7 statements to turn table borders off Windows XP Please tell me it doesn't take 7 statements to turn table borders off Office 2007
Competent Performer
Please tell me it doesn't take 7 statements to turn table borders off
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default Please tell me it doesn't take 7 statements to turn table borders off

I want to add code to a macro to turn off all but the bottom border in the header row of a table. I started the macro recorder, selected the first row, turned off all borders, then turned the bottom border back on. Here's the code I got:



Code:
Sub Macro1()
  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
  With Selection.Borders(wdBorderBottom)
    .LineStyle = Options.DefaultBorderLineStyle
    .LineWidth = Options.DefaultBorderLineWidth
    .Color = Options.DefaultBorderColor
  End With
End Sub
Is there really no wdBorderAll variable or something equivalent?
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please tell me it doesn't take 7 statements to turn table borders off showing results of If statements in a mail merge m&co Mail Merge 3 01-06-2012 07:27 PM
Please tell me it doesn't take 7 statements to turn table borders off Word VBA: add borders to active table tinfanide Word VBA 2 12-02-2011 05:53 AM
Insert table button doesn't work in Outlook 2010 e-mail message ironwoods Outlook 0 08-02-2010 12:24 PM
Converting document to PDF but table of contents doesn't work luthers Word 0 07-30-2009 03:29 PM
IF statements that shifts to right. kent Excel 0 01-19-2006 02:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft