![]() |
#1
|
|||
|
|||
![]()
Hello,
I'm stuck with another problem. I hope you can help me! So in my document I have a table with help text that says to select the right status (3 choices) in the custom ribbon. In most cases, when selecting a status, this table disappears and the choosen status appears in a new table. In some cases, I get an error message that says the fault lies with the Style = Table Grid. Everytime I get this error, my Word window also says Compatibility Mode, even though it's the same Word version as in the non-error case. Is this because in the compatibility mode, there is no such style as table grid? Sub ApplyStandardWorkflow(Control As IRibbonControl) With ActiveDocument Dim oRng As Range Set oRng = ActiveDocument.Tables(2).Rows(1).Cells(1).Range oRng.End = oRng.End - 1 'to exclude the end of cell marker oRng.Select Selection.Tables(1).Select Selection.Rows.Delete Selection.TypeBackspace Selection.TypeParagraph ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _ 1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed With Selection.Tables(1) If .Style <> "Table Grid" Then .Style = "Table Grid" End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = False .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = False .ApplyStyleRowBands = True .ApplyStyleColumnBands = False End With ActiveDocument.AttachedTemplate.BuildingBlockEntri es("StandardWorkflow").Insert _ Where:=Selection.Range, RichText:=True Selection.Rows.Delete Selection.TypeBackspace Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow) End With End Sub Thank you!! |
#2
|
||||
|
||||
![]()
What EXACTLY is this code supposed to achieve?
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
![]() |
Tags |
building block, table |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to make a table of contents in a grid | rodrigocarballo | Word | 1 | 11-11-2016 01:32 PM |
Making a grid with diagonal lines extending outside of table | stulutions | Publisher | 0 | 09-21-2016 10:15 AM |
![]() |
dionnaro | Word Tables | 1 | 05-24-2016 04:04 PM |
Problem when selecting a style in the styles list | patricebrel | Word | 2 | 01-09-2016 06:52 AM |
![]() |
NobodysPerfect | Word | 3 | 11-10-2014 12:49 PM |