On Thursday 21 July 2005 18:48, + Trevor Hughes wrote:
> [ MODERATED ] ***********************
> Hi I asked for help in a message two days ago byt my thread was hijacked so
> I am asking again. I am not going to waste bandwidth with the whole post
> again but it had the title "help with this macro: and a message did of
> <[EMAIL PROTECTED]>
>
> I have posted the files containing the macro and the source data at
> www.thewildfig.co.za/macro
>
> To summarize - I used some code supplied by Andrew Pitonyak to iterate
> through all the sheets of all the sxc/xls files in a directory and copy a
> block of information from them to a new file. I use some code he provided
> to me via this list and some code form his macro document using the tools
> library an calling DispatchSlot(5711) to copy to the clip board which works
> fine and then DispatchSlot(5712) to paste it where the problem lies. It
> does not seem to want to paste the clipboard contents into the new file.
>
> I would greatly appreciate anyone taking the trouble to have a look and
> give me a hand. Please feel free to reply directly to my email address. I
> will gladly post a summary of any solutions received.
Hi Trevor
As you are not subscribed you may not have seen that:
On Thursday 21 July 2005 22:50, Andrew Douglas Pitonyak wrote:
> Add the following near the top of the document:
> Dim oDisp As Object
> Dim oSourceFrame
> Dim oTargetFrame
>
> oDisp = createUnoService("com.sun.star.frame.DispatchHelper")
>
>
> Next, do NOT use the dispatch using a slot with the call that you use.
> This will ALWAYS use the primary document. You need to target your
> document as follows:
>
> 'copy the current selection to the clipboard.
> 'DispatchSlot(5711)
> oSourceFrame = oSrcDoc.getCurrentController().getFrame()
> oDisp.executeDispatch(oSourceFrame, ".uno:Copy", "", 0, Array())
> Print "Just copied"
>
> Do the same for the paste
> 'msgbox "just before paste"
> 'DispatchSlot(5712)
> oTargetFrame = oTargetDoc.getCurrentController().getFrame()
> oDisp.executeDispatch(oTargetFrame, ".uno:Paste", "", 0, Array())
> Print "Just pasted"
>
> And your macro should work just fine. At least it did for me.
Please reply to [email protected] only.
--
CPH : openoffice.org contributor
Maybe your question has been answered already?
http://user-faq.openoffice.org/#FAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]