hi,
I tried to add a revision table by vba routie. useing fllowing code
Dim oRevStyle As RevisionTableStyle
Set oRevStyle = oDoc.StylesManager.RevisionTableStyles.Item("Revision Table_NEW")
Dim oRevTable As RevisionTable
Set oRevTable = oDoc.ActiveSheet.RevisionTables.Add2(oPoint, , , , , oRevStyle)
It adds revision table is not shown correct in the drawing. I have to manually select certain style in the drawing.
I try doc.update or view.update. it doesnt work. any idea?
Hi,
How did you create the style?
Can you reproduce the problem with a simple copy of a built-in style? - and then e.g. modify label size.
What is not correct with the created table?
Could you add a very minimal non-confidental document that enables others to reproduce the problem?
Cheers,
sorry, i didnt state the issue clearly. The revision table style is not exist in "local styles" but in "all styles".
so after i run the code, it adds revision table on the drawing and adds revision table style in style selector. then, i have to manually select correct revision table style from style selector.
thanks for your reply.
Sub test()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oRevStyle As RevisionTableStyle
Set oRevStyle = oDoc.StylesManager.RevisionTableStyles.Item("Revision Table_NEW")
Dim oPoint As Point2d
Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(16, 10)
Dim oRevTable As RevisionTable
Set oRevTable = oDoc.ActiveSheet.RevisionTables.Add2(oPoint, , , , , oRevStyle)
End Sub
Hi,
have your tried with ConvertToLocal if it helps?
Dim oRevStyle As RevisionTableStyle
If oRevStyle.StyleLocation = kLibraryStyleLocation Then
oRevStyle.ConvertToLocal
End If
thanks. i will give it a try.
just wondering if i should insert this code before or after add revision table.
thanks.