![]() ![]() Now the table of contents has been created automatically. In Table of Contents tab, set the style and format as you like, then click OK to implement.Ĩ. Choose the style you prefer in the list or click Custom table of contents for further settings.ħ. Then select all the texts, click Table of Contents in References tab.Ħ. Or you can choose the level ( Heading 1, Heading 2, etc.) for exch text in Home tab– Styles group.ĥ. Choose as L evel 2, as L evel 3 in the same way. The Paragraph dialog box will display, go to Indents and Spacing tab, choose Level 1 in the box of Outline level and hit OK to confirm it.Ĥ. In my case, I select and right-click it, choose Paragraph in the pop-up window.ģ. Input names of the texts of catalog, and set the level of each one.Ģ. So how do you add a catalog to your work? In this post, I will share some experiences about creating a table of contents automatically based on Word 2016. The script for updating it is below: sub UpdateTOCĭim args1(18) as new .PropertyValueĪrgs1(2).Name = "SearchItem.RowDirection"Īrgs1(7).Name = "SearchItem.AsianOptions"Īrgs1(8).Name = "SearchItem.AlgorithmType"Īrgs1(10).Name = "SearchItem.SearchString"Īrgs1(11).Name = "SearchItem.ReplaceString"Īrgs1(13).Name = "SearchItem.ChangedChars"Īrgs1(14).Name = "SearchItem.DeletedChars"Īrgs1(15).Name = "SearchItem.InsertedChars"Īrgs1(16).Name = "SearchItem.TransliterateFlags"ĭispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1())ĭim args2(1) as new .PropertyValueĭispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args2())ĭispatcher.executeDispatch(document, ".Catalog is an important factor of Word layout especially when you are writing a rather long document. But this only works when openOffice ist started visible to he user. Openoffice pdf table of contents update#All the Makro is doing is to look the text "Content", move one line down and update the selected Table of content. I used a very simple and efficient work around by adding a global Makro to OpenOffice which will automatically execute my Makro when a document is opened. Openoffice pdf table of contents code#So I had to change my code to: wProperties := MakePropertyValue('Hidden', False) The update of the Table of Contents only works when the documnet is opened NOT hidden! ![]() Ok, now I found out about the problem and come up with an work around!ġ. It is just those two lines with the "oDispatcher" which don't do the job. Is there anything I forgot in the process? I haven't listed the whole source code which is pretty standard and works perfect. WProperties := MakePropertyValue('Hidden', True) įDocument := fDesktop.loadComponentFromURL('file:///' + FileName ![]() WProperties := VarArra圜reate(, varVariant) With those variants: fOpenOffice := CreateOleObject('') and do not include audio, video, or embedded. I doesn't give me an error message but it just doesn't fire.ĭocument = ĭispatcher = createUnoService(".DispatchHelper")ĭispatcher.executeDispatch(document, ".uno:UpdateCurIndex", "", 0, Array())īasically I use this to create it: oDispatcher := fOpenOffice.createInstance('.DispatchHelper') Fully printable (i.e., where dynamic features are limited to automatic page numbering, table of contents, etc. I recorded the macro of the TOC update and tried to use it but somehow it doesn't work. It doesn't matter so much in the DOC format, because the user can do it manually afterwards, but in PDF the user doesn't get this option. This works perfect so far but I have the problem that the table of content doesn't get updated. So my approach is that I generate the whole document in the open document format odt (Which is very neat after you worked your way through the specification and XML), then I use the openoffice com interfaces to open the document programmatically and save it in word or in pdf. I am basically creating a report and depending on the user selecting export it to different formats (odt, doc & pdf). At first to the background what I try to achieve. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |