Guest User

Untitled

a guest
Jul 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. REM ***** BASIC *****
  2. sub Main
  3. dim std_id as String
  4. dim std_score as String
  5. rem ----------------------------------------------------------------------
  6. rem define variables
  7. dim document as object
  8. dim dispatcher as object
  9. rem ----------------------------------------------------------------------
  10. rem get access to the document
  11. document = ThisComponent.CurrentController.Frame
  12. dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
  13. dim args1(0) as new com.sun.star.beans.PropertyValue
  14. dim args2(17) as new com.sun.star.beans.PropertyValue
  15. dim cell as Object
  16. dim c_row as Variant
  17. dim args3(0) as new com.sun.star.beans.PropertyValue
  18.  
  19. do while true
  20. std_id = InputBox( "Enter ID:" )
  21. if std_id = 0 then exit sub
  22. if std_id = "" then exit sub
  23.  
  24. rem ----------------------------------------------------------------------
  25. args1(0).Name = "Sel"
  26. args1(0).Value = false
  27.  
  28. dispatcher.executeDispatch(document, ".uno:GoToStart", "", 0, args1())
  29.  
  30. rem ----------------------------------------------------------------------
  31. args2(0).Name = "SearchItem.StyleFamily"
  32. args2(0).Value = 2
  33. args2(1).Name = "SearchItem.CellType"
  34. args2(1).Value = 0
  35. args2(2).Name = "SearchItem.RowDirection"
  36. args2(2).Value = true
  37. args2(3).Name = "SearchItem.AllTables"
  38. args2(3).Value = false
  39. args2(4).Name = "SearchItem.Backward"
  40. args2(4).Value = false
  41. args2(5).Name = "SearchItem.Pattern"
  42. args2(5).Value = false
  43. args2(6).Name = "SearchItem.Content"
  44. args2(6).Value = false
  45. args2(7).Name = "SearchItem.AsianOptions"
  46. args2(7).Value = false
  47. args2(8).Name = "SearchItem.AlgorithmType"
  48. args2(8).Value = 0
  49. args2(9).Name = "SearchItem.SearchFlags"
  50. args2(9).Value = 65536
  51. args2(10).Name = "SearchItem.SearchString"
  52. args2(10).Value = std_id
  53. args2(11).Name = "SearchItem.ReplaceString"
  54. args2(11).Value = ""
  55. args2(12).Name = "SearchItem.Locale"
  56. args2(12).Value = 255
  57. args2(13).Name = "SearchItem.ChangedChars"
  58. args2(13).Value = 2
  59. args2(14).Name = "SearchItem.DeletedChars"
  60. args2(14).Value = 2
  61. args2(15).Name = "SearchItem.InsertedChars"
  62. args2(15).Value = 2
  63. args2(16).Name = "SearchItem.TransliterateFlags"
  64. args2(16).Value = 1280
  65. args2(17).Name = "SearchItem.Command"
  66. args2(17).Value = 0
  67.  
  68. dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args2())
  69.  
  70. rem ----------------------------------------------------------------------
  71. cell = ThisComponent.getCurrentSelection()
  72. c_row = cell.CellAddress.row
  73. if(c_row) > 4 then
  74. std_score = InputBox("Enter Score:")
  75.  
  76. args3(0).Name = "ToPoint"
  77. args3(0).Value = "$N$" + (c_row + 1)
  78.  
  79. dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
  80.  
  81. cell = ThisComponent.getCurrentSelection()
  82. cell.setValue(std_score)
  83. end if
  84. loop
  85. end sub
Add Comment
Please, Sign In to add comment