sub FormatHeadersByImmigrantNameStd rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastNameStd(17) as new com.sun.star.beans.PropertyValue argsFindLastNameStd(0).Name = "SearchItem.StyleFamily" argsFindLastNameStd(0).Value = 2 argsFindLastNameStd(1).Name = "SearchItem.CellType" argsFindLastNameStd(1).Value = 0 argsFindLastNameStd(2).Name = "SearchItem.RowDirection" argsFindLastNameStd(2).Value = true argsFindLastNameStd(3).Name = "SearchItem.AllTables" argsFindLastNameStd(3).Value = false argsFindLastNameStd(4).Name = "SearchItem.Backward" argsFindLastNameStd(4).Value = false argsFindLastNameStd(5).Name = "SearchItem.Pattern" argsFindLastNameStd(5).Value = false argsFindLastNameStd(6).Name = "SearchItem.Content" argsFindLastNameStd(6).Value = false argsFindLastNameStd(7).Name = "SearchItem.AsianOptions" argsFindLastNameStd(7).Value = false argsFindLastNameStd(8).Name = "SearchItem.AlgorithmType" argsFindLastNameStd(8).Value = 0 argsFindLastNameStd(9).Name = "SearchItem.SearchFlags" argsFindLastNameStd(9).Value = 65552 argsFindLastNameStd(10).Name = "SearchItem.SearchString" argsFindLastNameStd(10).Value = "**" argsFindLastNameStd(11).Name = "SearchItem.ReplaceString" argsFindLastNameStd(11).Value = "" argsFindLastNameStd(12).Name = "SearchItem.Locale" argsFindLastNameStd(12).Value = 255 argsFindLastNameStd(13).Name = "SearchItem.ChangedChars" argsFindLastNameStd(13).Value = 2 argsFindLastNameStd(14).Name = "SearchItem.DeletedChars" argsFindLastNameStd(14).Value = 2 argsFindLastNameStd(15).Name = "SearchItem.InsertedChars" argsFindLastNameStd(15).Value = 2 argsFindLastNameStd(16).Name = "SearchItem.TransliterateFlags" argsFindLastNameStd(16).Value = 1280 argsFindLastNameStd(17).Name = "SearchItem.Command" argsFindLastNameStd(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-5 then exit do dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+3).getString="*" then dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) end if loop end sub sub FormatHeadersByImmigrantNameStdSummary rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastNameStd(17) as new com.sun.star.beans.PropertyValue argsFindLastNameStd(0).Name = "SearchItem.StyleFamily" argsFindLastNameStd(0).Value = 2 argsFindLastNameStd(1).Name = "SearchItem.CellType" argsFindLastNameStd(1).Value = 0 argsFindLastNameStd(2).Name = "SearchItem.RowDirection" argsFindLastNameStd(2).Value = true argsFindLastNameStd(3).Name = "SearchItem.AllTables" argsFindLastNameStd(3).Value = false argsFindLastNameStd(4).Name = "SearchItem.Backward" argsFindLastNameStd(4).Value = false argsFindLastNameStd(5).Name = "SearchItem.Pattern" argsFindLastNameStd(5).Value = false argsFindLastNameStd(6).Name = "SearchItem.Content" argsFindLastNameStd(6).Value = false argsFindLastNameStd(7).Name = "SearchItem.AsianOptions" argsFindLastNameStd(7).Value = false argsFindLastNameStd(8).Name = "SearchItem.AlgorithmType" argsFindLastNameStd(8).Value = 0 argsFindLastNameStd(9).Name = "SearchItem.SearchFlags" argsFindLastNameStd(9).Value = 65552 argsFindLastNameStd(10).Name = "SearchItem.SearchString" argsFindLastNameStd(10).Value = "**" argsFindLastNameStd(11).Name = "SearchItem.ReplaceString" argsFindLastNameStd(11).Value = "" argsFindLastNameStd(12).Name = "SearchItem.Locale" argsFindLastNameStd(12).Value = 255 argsFindLastNameStd(13).Name = "SearchItem.ChangedChars" argsFindLastNameStd(13).Value = 2 argsFindLastNameStd(14).Name = "SearchItem.DeletedChars" argsFindLastNameStd(14).Value = 2 argsFindLastNameStd(15).Name = "SearchItem.InsertedChars" argsFindLastNameStd(15).Value = 2 argsFindLastNameStd(16).Name = "SearchItem.TransliterateFlags" argsFindLastNameStd(16).Value = 1280 argsFindLastNameStd(17).Name = "SearchItem.Command" argsFindLastNameStd(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) loop end sub Sub FormatHeadersByDestinationDateSummary rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindShipTrip(17) as new com.sun.star.beans.PropertyValue argsFindShipTrip(0).Name = "SearchItem.StyleFamily" argsFindShipTrip(0).Value = 2 argsFindShipTrip(1).Name = "SearchItem.CellType" argsFindShipTrip(1).Value = 0 argsFindShipTrip(2).Name = "SearchItem.RowDirection" argsFindShipTrip(2).Value = true argsFindShipTrip(3).Name = "SearchItem.AllTables" argsFindShipTrip(3).Value = false argsFindShipTrip(4).Name = "SearchItem.Backward" argsFindShipTrip(4).Value = false argsFindShipTrip(5).Name = "SearchItem.Pattern" argsFindShipTrip(5).Value = false argsFindShipTrip(6).Name = "SearchItem.Content" argsFindShipTrip(6).Value = false argsFindShipTrip(7).Name = "SearchItem.AsianOptions" argsFindShipTrip(7).Value = false argsFindShipTrip(8).Name = "SearchItem.AlgorithmType" argsFindShipTrip(8).Value = 0 argsFindShipTrip(9).Name = "SearchItem.SearchFlags" argsFindShipTrip(9).Value = 65552 argsFindShipTrip(10).Name = "SearchItem.SearchString" argsFindShipTrip(10).Value = "**" argsFindShipTrip(11).Name = "SearchItem.ReplaceString" argsFindShipTrip(11).Value = "" argsFindShipTrip(12).Name = "SearchItem.Locale" argsFindShipTrip(12).Value = 255 argsFindShipTrip(13).Name = "SearchItem.ChangedChars" argsFindShipTrip(13).Value = 2 argsFindShipTrip(14).Name = "SearchItem.DeletedChars" argsFindShipTrip(14).Value = 2 argsFindShipTrip(15).Name = "SearchItem.InsertedChars" argsFindShipTrip(15).Value = 2 argsFindShipTrip(16).Name = "SearchItem.TransliterateFlags" argsFindShipTrip(16).Value = 1280 argsFindShipTrip(17).Name = "SearchItem.Command" argsFindShipTrip(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) loop end sub sub FormatHeadersByDestinationDate rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindShipTrip(17) as new com.sun.star.beans.PropertyValue argsFindShipTrip(0).Name = "SearchItem.StyleFamily" argsFindShipTrip(0).Value = 2 argsFindShipTrip(1).Name = "SearchItem.CellType" argsFindShipTrip(1).Value = 0 argsFindShipTrip(2).Name = "SearchItem.RowDirection" argsFindShipTrip(2).Value = true argsFindShipTrip(3).Name = "SearchItem.AllTables" argsFindShipTrip(3).Value = false argsFindShipTrip(4).Name = "SearchItem.Backward" argsFindShipTrip(4).Value = false argsFindShipTrip(5).Name = "SearchItem.Pattern" argsFindShipTrip(5).Value = false argsFindShipTrip(6).Name = "SearchItem.Content" argsFindShipTrip(6).Value = false argsFindShipTrip(7).Name = "SearchItem.AsianOptions" argsFindShipTrip(7).Value = false argsFindShipTrip(8).Name = "SearchItem.AlgorithmType" argsFindShipTrip(8).Value = 0 argsFindShipTrip(9).Name = "SearchItem.SearchFlags" argsFindShipTrip(9).Value = 65552 argsFindShipTrip(10).Name = "SearchItem.SearchString" argsFindShipTrip(10).Value = "**" argsFindShipTrip(11).Name = "SearchItem.ReplaceString" argsFindShipTrip(11).Value = "" argsFindShipTrip(12).Name = "SearchItem.Locale" argsFindShipTrip(12).Value = 255 argsFindShipTrip(13).Name = "SearchItem.ChangedChars" argsFindShipTrip(13).Value = 2 argsFindShipTrip(14).Name = "SearchItem.DeletedChars" argsFindShipTrip(14).Value = 2 argsFindShipTrip(15).Name = "SearchItem.InsertedChars" argsFindShipTrip(15).Value = 2 argsFindShipTrip(16).Name = "SearchItem.TransliterateFlags" argsFindShipTrip(16).Value = 1280 argsFindShipTrip(17).Name = "SearchItem.Command" argsFindShipTrip(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-6 then exit do if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+5).getString="*" then dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) end if loop end sub sub FormatHeadersByJoiningLocation rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsJoiningCityStateProvince(17) as new com.sun.star.beans.PropertyValue argsJoiningCityStateProvince(0).Name = "SearchItem.StyleFamily" argsJoiningCityStateProvince(0).Value = 2 argsJoiningCityStateProvince(1).Name = "SearchItem.CellType" argsJoiningCityStateProvince(1).Value = 0 argsJoiningCityStateProvince(2).Name = "SearchItem.RowDirection" argsJoiningCityStateProvince(2).Value = true argsJoiningCityStateProvince(3).Name = "SearchItem.AllTables" argsJoiningCityStateProvince(3).Value = false argsJoiningCityStateProvince(4).Name = "SearchItem.Backward" argsJoiningCityStateProvince(4).Value = false argsJoiningCityStateProvince(5).Name = "SearchItem.Pattern" argsJoiningCityStateProvince(5).Value = false argsJoiningCityStateProvince(6).Name = "SearchItem.Content" argsJoiningCityStateProvince(6).Value = false argsJoiningCityStateProvince(7).Name = "SearchItem.AsianOptions" argsJoiningCityStateProvince(7).Value = false argsJoiningCityStateProvince(8).Name = "SearchItem.AlgorithmType" argsJoiningCityStateProvince(8).Value = 0 argsJoiningCityStateProvince(9).Name = "SearchItem.SearchFlags" argsJoiningCityStateProvince(9).Value = 65552 argsJoiningCityStateProvince(10).Name = "SearchItem.SearchString" argsJoiningCityStateProvince(10).Value = "**" argsJoiningCityStateProvince(11).Name = "SearchItem.ReplaceString" argsJoiningCityStateProvince(11).Value = "" argsJoiningCityStateProvince(12).Name = "SearchItem.Locale" argsJoiningCityStateProvince(12).Value = 255 argsJoiningCityStateProvince(13).Name = "SearchItem.ChangedChars" argsJoiningCityStateProvince(13).Value = 2 argsJoiningCityStateProvince(14).Name = "SearchItem.DeletedChars" argsJoiningCityStateProvince(14).Value = 2 argsJoiningCityStateProvince(15).Name = "SearchItem.InsertedChars" argsJoiningCityStateProvince(15).Value = 2 argsJoiningCityStateProvince(16).Name = "SearchItem.TransliterateFlags" argsJoiningCityStateProvince(16).Value = 1280 argsJoiningCityStateProvince(17).Name = "SearchItem.Command" argsJoiningCityStateProvince(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-5 then exit do dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+3).getString="*" then dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) end if loop end sub sub FormatHeadersByJoiningLocationSummary rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsJoiningCityStateProvince(17) as new com.sun.star.beans.PropertyValue argsJoiningCityStateProvince(0).Name = "SearchItem.StyleFamily" argsJoiningCityStateProvince(0).Value = 2 argsJoiningCityStateProvince(1).Name = "SearchItem.CellType" argsJoiningCityStateProvince(1).Value = 0 argsJoiningCityStateProvince(2).Name = "SearchItem.RowDirection" argsJoiningCityStateProvince(2).Value = true argsJoiningCityStateProvince(3).Name = "SearchItem.AllTables" argsJoiningCityStateProvince(3).Value = false argsJoiningCityStateProvince(4).Name = "SearchItem.Backward" argsJoiningCityStateProvince(4).Value = false argsJoiningCityStateProvince(5).Name = "SearchItem.Pattern" argsJoiningCityStateProvince(5).Value = false argsJoiningCityStateProvince(6).Name = "SearchItem.Content" argsJoiningCityStateProvince(6).Value = false argsJoiningCityStateProvince(7).Name = "SearchItem.AsianOptions" argsJoiningCityStateProvince(7).Value = false argsJoiningCityStateProvince(8).Name = "SearchItem.AlgorithmType" argsJoiningCityStateProvince(8).Value = 0 argsJoiningCityStateProvince(9).Name = "SearchItem.SearchFlags" argsJoiningCityStateProvince(9).Value = 65552 argsJoiningCityStateProvince(10).Name = "SearchItem.SearchString" argsJoiningCityStateProvince(10).Value = "**" argsJoiningCityStateProvince(11).Name = "SearchItem.ReplaceString" argsJoiningCityStateProvince(11).Value = "" argsJoiningCityStateProvince(12).Name = "SearchItem.Locale" argsJoiningCityStateProvince(12).Value = 255 argsJoiningCityStateProvince(13).Name = "SearchItem.ChangedChars" argsJoiningCityStateProvince(13).Value = 2 argsJoiningCityStateProvince(14).Name = "SearchItem.DeletedChars" argsJoiningCityStateProvince(14).Value = 2 argsJoiningCityStateProvince(15).Name = "SearchItem.InsertedChars" argsJoiningCityStateProvince(15).Value = 2 argsJoiningCityStateProvince(16).Name = "SearchItem.TransliterateFlags" argsJoiningCityStateProvince(16).Value = 1280 argsJoiningCityStateProvince(17).Name = "SearchItem.Command" argsJoiningCityStateProvince(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) loop end sub sub FormatHeadersByLeavingNameStd rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastNameStd(17) as new com.sun.star.beans.PropertyValue argsFindLastNameStd(0).Name = "SearchItem.StyleFamily" argsFindLastNameStd(0).Value = 2 argsFindLastNameStd(1).Name = "SearchItem.CellType" argsFindLastNameStd(1).Value = 0 argsFindLastNameStd(2).Name = "SearchItem.RowDirection" argsFindLastNameStd(2).Value = true argsFindLastNameStd(3).Name = "SearchItem.AllTables" argsFindLastNameStd(3).Value = false argsFindLastNameStd(4).Name = "SearchItem.Backward" argsFindLastNameStd(4).Value = false argsFindLastNameStd(5).Name = "SearchItem.Pattern" argsFindLastNameStd(5).Value = false argsFindLastNameStd(6).Name = "SearchItem.Content" argsFindLastNameStd(6).Value = false argsFindLastNameStd(7).Name = "SearchItem.AsianOptions" argsFindLastNameStd(7).Value = false argsFindLastNameStd(8).Name = "SearchItem.AlgorithmType" argsFindLastNameStd(8).Value = 0 argsFindLastNameStd(9).Name = "SearchItem.SearchFlags" argsFindLastNameStd(9).Value = 65552 argsFindLastNameStd(10).Name = "SearchItem.SearchString" argsFindLastNameStd(10).Value = "**" argsFindLastNameStd(11).Name = "SearchItem.ReplaceString" argsFindLastNameStd(11).Value = "" argsFindLastNameStd(12).Name = "SearchItem.Locale" argsFindLastNameStd(12).Value = 255 argsFindLastNameStd(13).Name = "SearchItem.ChangedChars" argsFindLastNameStd(13).Value = 2 argsFindLastNameStd(14).Name = "SearchItem.DeletedChars" argsFindLastNameStd(14).Value = 2 argsFindLastNameStd(15).Name = "SearchItem.InsertedChars" argsFindLastNameStd(15).Value = 2 argsFindLastNameStd(16).Name = "SearchItem.TransliterateFlags" argsFindLastNameStd(16).Value = 1280 argsFindLastNameStd(17).Name = "SearchItem.Command" argsFindLastNameStd(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-5 then exit do dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+3).getString="*" then dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) end if loop end sub sub FormatHeadersByJoiningNameStd rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastNameStd(17) as new com.sun.star.beans.PropertyValue argsFindLastNameStd(0).Name = "SearchItem.StyleFamily" argsFindLastNameStd(0).Value = 2 argsFindLastNameStd(1).Name = "SearchItem.CellType" argsFindLastNameStd(1).Value = 0 argsFindLastNameStd(2).Name = "SearchItem.RowDirection" argsFindLastNameStd(2).Value = true argsFindLastNameStd(3).Name = "SearchItem.AllTables" argsFindLastNameStd(3).Value = false argsFindLastNameStd(4).Name = "SearchItem.Backward" argsFindLastNameStd(4).Value = false argsFindLastNameStd(5).Name = "SearchItem.Pattern" argsFindLastNameStd(5).Value = false argsFindLastNameStd(6).Name = "SearchItem.Content" argsFindLastNameStd(6).Value = false argsFindLastNameStd(7).Name = "SearchItem.AsianOptions" argsFindLastNameStd(7).Value = false argsFindLastNameStd(8).Name = "SearchItem.AlgorithmType" argsFindLastNameStd(8).Value = 0 argsFindLastNameStd(9).Name = "SearchItem.SearchFlags" argsFindLastNameStd(9).Value = 65552 argsFindLastNameStd(10).Name = "SearchItem.SearchString" argsFindLastNameStd(10).Value = "**" argsFindLastNameStd(11).Name = "SearchItem.ReplaceString" argsFindLastNameStd(11).Value = "" argsFindLastNameStd(12).Name = "SearchItem.Locale" argsFindLastNameStd(12).Value = 255 argsFindLastNameStd(13).Name = "SearchItem.ChangedChars" argsFindLastNameStd(13).Value = 2 argsFindLastNameStd(14).Name = "SearchItem.DeletedChars" argsFindLastNameStd(14).Value = 2 argsFindLastNameStd(15).Name = "SearchItem.InsertedChars" argsFindLastNameStd(15).Value = 2 argsFindLastNameStd(16).Name = "SearchItem.TransliterateFlags" argsFindLastNameStd(16).Value = 1280 argsFindLastNameStd(17).Name = "SearchItem.Command" argsFindLastNameStd(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-5 then exit do dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, argsGoRight()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:MergeCells", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:WrapText", "", 0, argsWrapText()) dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, argsGoLeft()) if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+3).getString="*" then dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) end if loop end sub sub FormatHeadersNameIndex rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim argsGotoStart(0) as new com.sun.star.beans.PropertyValue argsGotoStart(0).Name = "Sel" argsGotoStart(0).Value = false dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastRow(17) as new com.sun.star.beans.PropertyValue argsFindLastRow(0).Name = "SearchItem.StyleFamily" argsFindLastRow(0).Value = 2 argsFindLastRow(1).Name = "SearchItem.CellType" argsFindLastRow(1).Value = 0 argsFindLastRow(2).Name = "SearchItem.RowDirection" argsFindLastRow(2).Value = true argsFindLastRow(3).Name = "SearchItem.AllTables" argsFindLastRow(3).Value = false argsFindLastRow(4).Name = "SearchItem.Backward" argsFindLastRow(4).Value = false argsFindLastRow(5).Name = "SearchItem.Pattern" argsFindLastRow(5).Value = false argsFindLastRow(6).Name = "SearchItem.Content" argsFindLastRow(6).Value = false argsFindLastRow(7).Name = "SearchItem.AsianOptions" argsFindLastRow(7).Value = false argsFindLastRow(8).Name = "SearchItem.AlgorithmType" argsFindLastRow(8).Value = 0 argsFindLastRow(9).Name = "SearchItem.SearchFlags" argsFindLastRow(9).Value = 65552 argsFindLastRow(10).Name = "SearchItem.SearchString" argsFindLastRow(10).Value = "***" argsFindLastRow(11).Name = "SearchItem.ReplaceString" argsFindLastRow(11).Value = "" argsFindLastRow(12).Name = "SearchItem.Locale" argsFindLastRow(12).Value = 255 argsFindLastRow(13).Name = "SearchItem.ChangedChars" argsFindLastRow(13).Value = 2 argsFindLastRow(14).Name = "SearchItem.DeletedChars" argsFindLastRow(14).Value = 2 argsFindLastRow(15).Name = "SearchItem.InsertedChars" argsFindLastRow(15).Value = 2 argsFindLastRow(16).Name = "SearchItem.TransliterateFlags" argsFindLastRow(16).Value = 1280 argsFindLastRow(17).Name = "SearchItem.Command" argsFindLastRow(17).Value = 0 dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, argsFindLastRow()) lastrow=ThisComponent.CurrentSelection.RangeAddress.StartRow dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) rem ---------------------------------------------------------------------- dim argsFindLastNameStd(17) as new com.sun.star.beans.PropertyValue argsFindLastNameStd(0).Name = "SearchItem.StyleFamily" argsFindLastNameStd(0).Value = 2 argsFindLastNameStd(1).Name = "SearchItem.CellType" argsFindLastNameStd(1).Value = 0 argsFindLastNameStd(2).Name = "SearchItem.RowDirection" argsFindLastNameStd(2).Value = true argsFindLastNameStd(3).Name = "SearchItem.AllTables" argsFindLastNameStd(3).Value = false argsFindLastNameStd(4).Name = "SearchItem.Backward" argsFindLastNameStd(4).Value = false argsFindLastNameStd(5).Name = "SearchItem.Pattern" argsFindLastNameStd(5).Value = false argsFindLastNameStd(6).Name = "SearchItem.Content" argsFindLastNameStd(6).Value = false argsFindLastNameStd(7).Name = "SearchItem.AsianOptions" argsFindLastNameStd(7).Value = false argsFindLastNameStd(8).Name = "SearchItem.AlgorithmType" argsFindLastNameStd(8).Value = 0 argsFindLastNameStd(9).Name = "SearchItem.SearchFlags" argsFindLastNameStd(9).Value = 65552 argsFindLastNameStd(10).Name = "SearchItem.SearchString" argsFindLastNameStd(10).Value = "**" argsFindLastNameStd(11).Name = "SearchItem.ReplaceString" argsFindLastNameStd(11).Value = "" argsFindLastNameStd(12).Name = "SearchItem.Locale" argsFindLastNameStd(12).Value = 255 argsFindLastNameStd(13).Name = "SearchItem.ChangedChars" argsFindLastNameStd(13).Value = 2 argsFindLastNameStd(14).Name = "SearchItem.DeletedChars" argsFindLastNameStd(14).Value = 2 argsFindLastNameStd(15).Name = "SearchItem.InsertedChars" argsFindLastNameStd(15).Value = 2 argsFindLastNameStd(16).Name = "SearchItem.TransliterateFlags" argsFindLastNameStd(16).Value = 1280 argsFindLastNameStd(17).Name = "SearchItem.Command" argsFindLastNameStd(17).Value = 0 rem ---------------------------------------------------------------------- dim argsGoUp(1) as new com.sun.star.beans.PropertyValue argsGoUp(0).Name = "By" argsGoUp(0).Value = 1 argsGoUp(1).Name = "Sel" argsGoUp(1).Value = false rem ---------------------------------------------------------------------- dim argsBold(0) as new com.sun.star.beans.PropertyValue argsBold(0).Name = "Bold" argsBold(0).Value = true rem ---------------------------------------------------------------------- dim argsCenter(0) as new com.sun.star.beans.PropertyValue argsCenter(0).Name = "HorizontalAlignment" argsCenter(0).Value = com.sun.star.table.CellHoriJustify.CENTER rem ---------------------------------------------------------------------- dim argsGoDown(1) as new com.sun.star.beans.PropertyValue argsGoDown(0).Name = "By" argsGoDown(0).Value = 1 argsGoDown(1).Name = "Sel" argsGoDown(1).Value = false rem ---------------------------------------------------------------------- dim argsGoRight(1) as new com.sun.star.beans.PropertyValue argsGoRight(0).Name = "By" argsGoRight(0).Value = 1 argsGoRight(1).Name = "Sel" argsGoRight(1).Value = false rem ---------------------------------------------------------------------- dim argsGoLeft(1) as new com.sun.star.beans.PropertyValue argsGoLeft(0).Name = "By" argsGoLeft(0).Value = 1 argsGoLeft(1).Name = "Sel" argsGoLeft(1).Value = false rem ---------------------------------------------------------------------- dim argsGreenBackground(0) as new com.sun.star.beans.PropertyValue argsGreenBackground(0).Name = "BackgroundColor" argsGreenBackground(0).Value = 65280 rem ---------------------------------------------------------------------- dim argsBlueBackground(0) as new com.sun.star.beans.PropertyValue argsBlueBackground(0).Name = "BackgroundColor" argsBlueBackground(0).Value = 65535 rem ---------------------------------------------------------------------- dim argsYellowBackground(0) as new com.sun.star.beans.PropertyValue argsYellowBackground(0).Name = "BackgroundColor" argsYellowBackground(0).Value = 16776960 rem ---------------------------------------------------------------------- dim argsFindImmigrantLine(17) as new com.sun.star.beans.PropertyValue argsFindImmigrantLine(0).Name = "SearchItem.StyleFamily" argsFindImmigrantLine(0).Value = 2 argsFindImmigrantLine(1).Name = "SearchItem.CellType" argsFindImmigrantLine(1).Value = 0 argsFindImmigrantLine(2).Name = "SearchItem.RowDirection" argsFindImmigrantLine(2).Value = true argsFindImmigrantLine(3).Name = "SearchItem.AllTables" argsFindImmigrantLine(3).Value = false argsFindImmigrantLine(4).Name = "SearchItem.Backward" argsFindImmigrantLine(4).Value = false argsFindImmigrantLine(5).Name = "SearchItem.Pattern" argsFindImmigrantLine(5).Value = false argsFindImmigrantLine(6).Name = "SearchItem.Content" argsFindImmigrantLine(6).Value = false argsFindImmigrantLine(7).Name = "SearchItem.AsianOptions" argsFindImmigrantLine(7).Value = false argsFindImmigrantLine(8).Name = "SearchItem.AlgorithmType" argsFindImmigrantLine(8).Value = 0 argsFindImmigrantLine(9).Name = "SearchItem.SearchFlags" argsFindImmigrantLine(9).Value = 65552 argsFindImmigrantLine(10).Name = "SearchItem.SearchString" argsFindImmigrantLine(10).Value = "*" argsFindImmigrantLine(11).Name = "SearchItem.ReplaceString" argsFindImmigrantLine(11).Value = "" argsFindImmigrantLine(12).Name = "SearchItem.Locale" argsFindImmigrantLine(12).Value = 255 argsFindImmigrantLine(13).Name = "SearchItem.ChangedChars" argsFindImmigrantLine(13).Value = 2 argsFindImmigrantLine(14).Name = "SearchItem.DeletedChars" argsFindImmigrantLine(14).Value = 2 argsFindImmigrantLine(15).Name = "SearchItem.InsertedChars" argsFindImmigrantLine(15).Value = 2 argsFindImmigrantLine(16).Name = "SearchItem.TransliterateFlags" argsFindImmigrantLine(16).Value = 1280 argsFindImmigrantLine(17).Name = "SearchItem.Command" argsFindImmigrantLine(17).Value = 0 rem ---------------------------------------------------------------------- dim argsWrapText(0) as new com.sun.star.beans.PropertyValue argsWrapText(0).Name = "WrapText" argsWrapText(0).Value = true rem ---------------------------------------------------------------------- dim argsPoint12(2) as new com.sun.star.beans.PropertyValue argsPoint12(0).Name = "FontHeight.Height" argsPoint12(0).Value = 12 argsPoint12(1).Name = "FontHeight.Prop" argsPoint12(1).Value = 100 argsPoint12(2).Name = "FontHeight.Diff" argsPoint12(2).Value = 0 rem ---------------------------------------------------------------------- dim argsPoint14(2) as new com.sun.star.beans.PropertyValue argsPoint14(0).Name = "FontHeight.Height" argsPoint14(0).Value = 14 argsPoint14(1).Name = "FontHeight.Prop" argsPoint14(1).Value = 100 argsPoint14(2).Name = "FontHeight.Diff" argsPoint14(2).Value = 0 do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-1 then exit do dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsBlueBackground()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:FontHeight", "", 0, argsPoint14()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsGreenBackground()) dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:SelectRow", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:Bold", "", 0, argsBold()) dispatcher.executeDispatch(document, ".uno:HorizontalAlignment", "", 0, argsCenter()) dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoDown()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) loop dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, argsGotoStart()) do while ThisComponent.CurrentSelection.RangeAddress.StartRow=lastrow-5 then exit do for i=2 to 5 if ThisComponent.getSheets().getByIndex(0).getCellByPosition(0,ThisComponent.CurrentSelection.RangeAddress.StartRow+i).getString="*" then for j=1 to i-1 dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, argsGoUp()) next j dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:GoRightSel", "", 0, Array()) dispatcher.executeDispatch(document, ".uno:BackgroundColor", "", 0, argsYellowBackground()) dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, argsGoUp()) exit for end if next i loop end sub