That is, when i press control+v, the values must be pasted but not the formats. I am able to assign the Ctrl+V key to the macro.
The problem is, this changes the functioning of the Ctrl+V for all the calc documents. Other users get confused. When they try to paste the values with formats, it pastes the value only.
Is there a way to assign this control+V key to my macro for the particular calc document only.
I have given the code below (The code works perfectly.)
Code: Select all
Sub PasteValueOnly
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oFrame = ThisComponent.CurrentController.Frame
dim args7(5) as new com.sun.star.beans.PropertyValue
args7(0).Name = "Flags"
args7(0).Value = "SVD"
args7(1).Name = "FormulaCommand"
args7(1).Value = 0
args7(2).Name = "SkipEmptyCells"
args7(2).Value = false
args7(3).Name = "Transpose"
args7(3).Value = false
args7(4).Name = "AsLink"
args7(4).Value = false
args7(5).Name = "MoveMode"
args7(5).Value = 4
oDispatcher.executeDispatch(oFrame, ".uno:InsertContents", "", 0, args7())
End Sub