Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 09-06-2022, 12:23 AM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Windows 10 Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Office 2019
Competent Performer
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value?
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Default

Here is my script for all tables in a document. Had to rearrange the order of certain things. But this below works for me
For this bellow script, I've created for the Last Row:

Code:
 
   Dim xTbl As Table
   Dim sVar1 As WdLineWidth           'For the Last Row: Value to put as Top Border
   Dim sVar2 As WdLineWidth           'For the Last Row: Value to put as Bottom Border
   Dim LineWidth As Borders
    
    sVar1 = InputBox("Last Row - Enter the size value from the below choices before the symbole = for the Top Border." _
      & vbCr & "Exemple : 2 =0.25/ 4 =0.50/ 6 =0.75/ 8 =1.00/" _
      & vbCr & "12 =1.50/ 18 =2.25/ 24 =3.00/ 36 =4.50/ 48 =6.00.", "SUGGESTION", "8")

    sVar2 = InputBox("Last Row - Enter the size value from the below choices before the symbole = for the Bottom Border." _
      & vbCr & "Exemple : 2 =0.25/ 4 =0.50/ 6 =0.75/ 8 =1.00/" _
      & vbCr & "12 =1.50/ 18 =2.25/ 24 =3.00/ 36 =4.50/ 48 =6.00.", "SUGGESTION", "18")
    
    For Each xTbl In ActiveDocument.Tables
      xTbl.Rows.Last.Range.Select

     With Selection.Range
       With .Borders(wdBorderTop)
            .LineStyle = wdLineStyleSingle
            .LineWidth = sVar1
            .Color = wdColorAutomatic
       End With

       With .Borders(wdBorderBottom)
            .LineStyle = wdLineStyleSingle
            .LineWidth = sVar2
            .Color = wdColorAutomatic
       End With
     End With
  
   Next xTbl
  
  On Error GoTo 0
Hopefully it works for others on their PC's.

Cendrinne

Last edited by Cendrinne; 09-06-2022 at 12:27 AM. Reason: again, fixed commas, as decimals for dot's, since my system is in French.
Reply With Quote
 

Tags
borders, help please, variant



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with table borders synint Word 2 12-02-2021 01:44 AM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? How is a variant array created to pass properties to a style? Peterson Word VBA 2 09-06-2021 05:52 PM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? table over 2 pages without borders ljosmynd Word Tables 1 02-02-2016 12:29 AM
Help, Please, Table Borders LineWidth act as a Variant. Why Variant disregards my variant value? Page-crossing borders in a table with hidden between-cell borders tenpaiman Word 2 08-08-2012 07:20 PM
how can i make random variant neezeen Word 0 11-22-2011 08:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:11 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