1
1

StoreSelect.bas 981 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Attribute VB_Name = "StoreSelect"
  2. Private sr_mem(3) As New ShapeRange
  3. Public StoreCount As String
  4. Public Function Store_Instruction(id As Integer, INST As String) As String
  5. On Error GoTo ErrorHandler
  6. API.BeginOpt "Undo MRC"
  7. '// Ñ¡ÔñÖ¸ÁîÖ´ÐÐ
  8. Case_Select_Range id, INST
  9. StoreCount = "Store Count: A->" & sr_mem(1).Count & " B->" & sr_mem(2).Count & " C->" & sr_mem(3).Count
  10. ErrorHandler:
  11. API.EndOpt
  12. End Function
  13. Private Function Case_Select_Range(id As Integer, INST As String)
  14. On Error GoTo ErrorHandler
  15. Select Case INST
  16. Case "add"
  17. sr_mem(id).AddRange ActiveSelectionRange
  18. Case "sub"
  19. sr_mem(id).RemoveRange ActiveSelectionRange
  20. Case "lw"
  21. '// ActiveDocument.ClearSelection
  22. sr_mem(id).AddToSelection
  23. Case "zero"
  24. If id = 3 Then
  25. sr_mem(3).RemoveAll: sr_mem(1).RemoveAll: sr_mem(2).RemoveAll
  26. Else
  27. sr_mem(id).RemoveAll
  28. End If
  29. End Select
  30. ErrorHandler:
  31. API.EndOpt
  32. End Function