Ask Your Question
0

Copy String from Calc Cell [Solved] [closed]

asked 2015-12-21 02:07:20 +0200

macroman gravatar image

Hi there,

I seem to be having trouble copying a string from a calc cell. Every time I try to paste the copied information into a writer doc, it pastes the entire cell rather than just the text. Here is a code snippet, all terms have been defined and Frame and Frame2 are the Writer doc and Calc doc respectively.

InfoCell = CalcDoc.Sheets(2).getCellbyPosition(2, 3)
Info = InfoCell.String
CalcDoc.CurrentController.Select(Info)
dispatcher.executeDispatch(Frame2, ".uno:Copy", "", 0, Array())
dispatcher.executeDispatch(Frame, ".uno:Paste", "", 0, Array())
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-12 02:52:43.733072

1 Answer

Sort by » oldest newest most voted
0

answered 2015-12-21 02:06:41 +0200

macroman gravatar image
Frame = WriterDoc.CurrentController.Frame
Frame2 = CalcDoc.CurrentController.Frame

  dim args1(0) as new com.sun.star.beans.PropertyValue
  args1(0).Name = "ToPoint"
  args1(0).Value = "$C$4"
  dispatcher.executeDispatch(Frame2, ".uno:GoToCell", "", 0, args1())
  dispatcher.executeDispatch(Frame2, ".uno:Copy", "", 0, Array())

  dim args2(0) as new com.sun.star.beans.PropertyValue
  args2(0).Name = "SelectedFormat"
  args2(0).Value = 10
  dispatcher.executeDispatch(Frame, ".uno:ClipboardFormatItems", "", 0, args2())
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-12-21 01:32:23 +0200

Seen: 145 times

Last updated: Dec 21 '15