Description: Hello, I am using VBA (from MS Access) to generate writer documnet. When dealing with tables, i am unable to modify the TableColumnSepartor property from VB OOO. Same functionality implemented as a Macro in the writer document is working. (document is attached) My VB ooo code: Sub ResizeColumnTable() Dim oSM 'Root object for accessing OpenOffice from VB Dim oDesk, oDoc As Object 'First objects from the API Dim arg() 'Instantiate OOo Set oSM = CreateObject("com.sun.star.ServiceManager") ' Create the first and most important service Set oDesk = oSM.CreateInstance("com.sun.star.frame.Desktop") ' file must be full access to the file to be uploaded Set oDoc = oDesk.loadComponentFromURL("file:///c:/.../bugColumnSeparator.odt", "_blank", 0, arg()) ' ++++++++++++++++++++++++++ table management ++++++++++++++ Dim oRepTables As Object Set oRepTables = oDoc.getTextTables Dim oTableRep As Object Set oTableRep = oRepTables.GetByName("tbl_table1") ' modify table column separator Dim objColumnSeparator As Object objColumnSeparator = oTableRep.GetPropertyValue("TableColumnSeparators") objColumnSeparator(0).Position = 1000 objColumnSeparator(1).Position = 2000 objColumnSeparator(2).Position = 3000 objColumnSeparator(2).Position = 4000 oTableRep.SetPropertyValue "TableColumnSeparators", objColumnSeparator 'Save the document as a new document Call oDoc.storeToURL("file:///c:/...../bugColumnSeparatorUpdated.odt", arg()) 'Close the document oDoc.Close (True) Set oDoc = Nothing End Sub I have attached the writer document that contains the same functionality developped as a macro (main) Steps to Reproduce: 1.run the VB code provided in the description 2.file will not have the column sized modified 3.running macro in the writer document make it work Actual Results: table columns are not changed in size Expected Results: table column sized changed (same as the main macro in the attached document) Reproducible: Always User Profile Reset: Yes Additional Info: Sub ResizeColumnTable() Dim oSM 'Root object for accessing OpenOffice from VB Dim oDesk, oDoc As Object 'First objects from the API Dim arg() 'Instantiate OOo Set oSM = CreateObject("com.sun.star.ServiceManager") ' Create the first and most important service Set oDesk = oSM.CreateInstance("com.sun.star.frame.Desktop") ' file must be full access to the file to be uploaded Set oDoc = oDesk.loadComponentFromURL("file:///c:/.../bugColumnSeparator.odt", "_blank", 0, arg()) ' ++++++++++++++++++++++++++ table management ++++++++++++++ Dim oRepTables As Object Set oRepTables = oDoc.getTextTables Dim oTableRep As Object Set oTableRep = oRepTables.GetByName("tbl_table1") ' modify table column separator Dim objColumnSeparator As Object objColumnSeparator = oTableRep.GetPropertyValue("TableColumnSeparators") objColumnSeparator(0).Position = 1000 objColumnSeparator(1).Position = 2000 objColumnSeparator(2).Position = 3000 objColumnSeparator(2).Position = 4000 oTableRep.SetPropertyValue "TableColumnSeparators", objColumnSeparator 'Save the document as a new document Call oDoc.storeToURL("file:///c:/...../bugColumnSeparatorUpdated.odt", arg()) 'Close the document oDoc.Close (True) Set oDoc = Nothing End Sub
Created attachment 153529 [details] Writer with working macro
it works for me woth LO 6.3.0.4 if i use: oTableRep.TableColumnSeparators = objColumnSeparator instead of: oTableRep.SetPropertyValue "TableColumnSeparators", objColumnSeparator Sub Main() Dim arg() Set oSM = CreateObject("com.sun.star.ServiceManager") Set oDesk = oSM.CreateInstance("com.sun.star.frame.Desktop") Set oDoc = oDesk.loadComponentFromURL("file:///d:/downloads/BugTablecolumnSeparator.odt", "_blank", 0, arg) Set oRepTables = oDoc.getTextTables Set oTableRep = oRepTables.GetByName("tbl_table1") objColumnSeparator = oTableRep.GetPropertyValue("TableColumnSeparators") objColumnSeparator(0).Position = 1000 objColumnSeparator(1).Position = 2000 objColumnSeparator(2).Position = 3000 objColumnSeparator(3).Position = 4000 oTableRep.TableColumnSeparators = objColumnSeparator ' oTableRep.SetPropertyValue "TableColumnSeparators", objColumnSeparator MsgBox "..." oDoc.Close (True) Set oDoc = Nothing End Sub
Hello, Thanks for your answer. I did not test that before posting the bug with version 6.3.0.4. I have just tested it and it works. Closing the issue now. Regards, Didier