Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.formatting.longdocs
|
|||
|
|||
![]()
Working with Word 2003.
I have a table formatting function to apply font format from a table cell to another table. While code fragment #1 works fine, I would expect code fragment #2 behaves the same. However, it is not. I have to modify it to code fragment #3 to make it work as I expected. Private Sub FormatTable() Dim objSourceTable As Word.Table Dim objTargetTable As Word.Table Dim objSourceFont As Word.Font Set objSourceTable = get a reference to table A in active document Set objTargetTable = get a reference to table B in active document Set objSourceFont = objSourceTable.Cell(1, 1).Range.Font.Duplicate ' #1 - OK, font attributes applied correctly objTargetTable.Cell(2, 2).Font = objSourceFont ' #2 - Not OK objTargetTable.Columns(1).Select objTargetTable.Application.Selection.Font = objSourceFont ' #3 - OK objTargetTable.Columns(1).Select objTargetTable.Application.Selection.Font.Bold = objSourceFont.Bold apply other attribute one by one ........... End Sub Therefore I would like to verify why #2 is not working? What is the proper way to apply font attributes? Looks like #1 is faster? |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I apply a different font to a cross reference? | Microsoft Word Help | |||
Why won't word allow me to apply different font? | Microsoft Word Help | |||
Default font - possible bulletproof fix in Word 2003 | Microsoft Word Help | |||
How do I ensure that the font attributes do not affect all of tex. | Microsoft Word Help | |||
Can't apply Arabic Font ? | Microsoft Word Help |