Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-26-2021, 07:50 PM
Bikram Bikram is offline Formatting only visible borders Windows 10 Formatting only visible borders Office 2007
Advanced Beginner
Formatting only visible borders
 
Join Date: Jul 2021
Location: Nepal
Posts: 90
Bikram is on a distinguished road
Post Formatting only visible borders

Greetings to all the seniors, I am facing a problem and looking forward to a solution.

I have a macro to format tables in word

Sub formattingtables()


Dim doc as documents
Dim t as tables
Dim tt as integer
Dim I as integer

Set doc = Application.Activedocument
Set t = Activedocument.range.tables
tt = t.count

For i = 1 to tt

' If doc.tables(i) is in odd pages then
With doc.Tables(i)
With doc.Tables(i).Borders(wdBorderLeft)
.LineWidth = wdLineWidth150pt
.Color = -587137089
End With
With doc.Tables(i).Borders(wdBorderRight)
.LineWidth = wdLineWidth150pt
.Color = -587137089
End With

With doc.Tables(i).Borders(wdBorderTop)
.LineWidth = wdLineWidth150pt
.Color = -587137089
End With

With doc.Tables(i).Borders(wdBorderBottom)
.LineWidth = wdLineWidth150pt
.Color = -587137089
End With
With doc.Tables(i).Borders(wdBorderHorizontal)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137089
End With
With doc.Tables(i).Borders(wdBorderVertical)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = -587137089
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth150pt

End With
End With


Next


End Sub

It set the borders to all the borders whether it is visible or not. And that is the problem I am trying to solve. How can I format only those borders which are visible and leave the invisible borders untouched.

Looking forward for help. Thanks in advance!!
Reply With Quote
Reply

Tags
formatting tables, visible borders

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syleref not visible m.rajabzade@gmail.com Word 5 03-14-2019 05:34 AM
styleref not visible m.rajabzade@gmail.com Word 1 03-14-2019 01:07 AM
Formatting only visible borders Page-crossing borders in a table with hidden between-cell borders tenpaiman Word 2 08-08-2012 07:20 PM
Formatting a table with double borders qwertyas PowerPoint 2 05-02-2012 05:10 AM
No Header Gap visible? dr_mik Word 0 11-25-2009 06:10 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:48 PM.


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