stecstec
04-11-2006, 03:07 AM
Hi there,
probably a simple solution to this one, keep getting a type mismatch on this code. Is it possible to use a variable within an object collection?
Cheers for any help, Steve.
(I'm trying a subroutine to format a table cell with a variable width and shading percentage.)Public Sub TableCellFormat(ByVal sBookmark As String, _
ByVal sWidth As Integer, _
ByVal sShading As Integer)
Dim sCellWidth As String
Dim sCellShading As String
ActiveDocument.Bookmarks(sBookmark).Select
Selection.SelectCell
' Border width
sCellWidth = "wdLineWidth" & sWidth & "pt"
With Selection.Borders
.OutsideLineWidth = sCellWidth
End With
' Cell shading - yet to do..
End Sub
probably a simple solution to this one, keep getting a type mismatch on this code. Is it possible to use a variable within an object collection?
Cheers for any help, Steve.
(I'm trying a subroutine to format a table cell with a variable width and shading percentage.)Public Sub TableCellFormat(ByVal sBookmark As String, _
ByVal sWidth As Integer, _
ByVal sShading As Integer)
Dim sCellWidth As String
Dim sCellShading As String
ActiveDocument.Bookmarks(sBookmark).Select
Selection.SelectCell
' Border width
sCellWidth = "wdLineWidth" & sWidth & "pt"
With Selection.Borders
.OutsideLineWidth = sCellWidth
End With
' Cell shading - yet to do..
End Sub