I develop report generator and try to use for it Qt+ActiveQt. Now I try generate table of contents, I saw at MS Word Macros:
Selection.TypeText Text:="First"
Selection.Style = ActiveDocument.Styles("Heading 1")
Selection.TypeParagraph
Selection.TypeText Text:="Second"
Selection.Style = ActiveDocument.Styles("Heading 1")
Selection.TypeParagraph
Selection.TypeText Text:="Third"
Selection.Style = ActiveDocument.Styles("Heading 1")
ActiveDocument.AttachedTemplate.BuildingBlockEntries( _
"automatic table of 1").Insert Where:=Selection.Range, RichText:= _
True
I know how to open new document, print text and save it all, but I don't understand how I can change style for table of content generation. Anybody solved this task?
Aucun commentaire:
Enregistrer un commentaire