First of all, thank you for taking the time to answer.

My answers appear later on.

2008/10/11 Andrew Douglas Pitonyak <[EMAIL PROTECTED]>

> Ely Schoenfeld wrote:
>
>> Sorry, I forgot to add the question:
>>
>> Does some one knows how to delete the links to other documents from a
>> macro/function/button?
>>
>> Ely.
>>
>>
> Do you mean in a Calc document?
>

Yes, I'm talking about the whole calc document.


>
> Do you mean for a specific Sheet?


See previous answer.


>
> If you call getLinkUrl() on the sheet in question, does it return
> something?


Well, the first time it returned the current file url, I mean the file where
the tests where done, instead of the "remote" file.  Then I closed and
opened again the document and now it's returning just the path to "My
documents" (very strange)


>
> Better yet, if you call getLinkMode(), what value is returned?
>

It returns 0  (com.sun.star.sheet.SheetLinkMode.NONE)


>
> What happens if you call
> oSheet.setLinkMode(com.sun.star.sheet.SheetLinkMode.NONE)?
>

It just changes the result of getLinkMode(), nothing else. I think it
establishes the "mode" for future copy/paste procedures. (Am I right?)

I present the functions I used at the end of this message, just in case
someone else needs them.

While I was looking for a way to delete the links to other documents from a
macro, I found someone who wants to do the same: "DDE Refresh and clean up"
at
http://user.services.openoffice.org/en/forum/viewtopic.php?f=20&t=4076&p=49673#p49673

Someone redirected him to "Programming actions, where macro recorder and API
fail" at
http://www.oooforum.org/forum/viewtopic.phtml?t=22845&postdays=0&postorder=asc&start=0

The author of the second thread says:

----- begin -------
The following describes a procedure to circumvent this problem. The basic
steps are

(1) Create a TopWindowListener
(2) execute the dispatch
(3) the dispatch opens a new top window
(4) the top window listener is called
(5) inside the top window listener, the accessibility interface is used to
execute the desired user interactions
(6) inside the top window listener, the dispatch dialog's OK Button is
pressed to terminate the dispatch
(7) the TopWindowListener is removed
------ end -------

That is a great thing to know. My problem is that I haven't  been able to
understand  the use of the api documentation enough, so I cant figure out
how to  modify the examples presented there, to my benefit.

The examples contain:

dispatcher.executeDispatch(oFrame, ".uno:InsertObject", "", 0, Array())
or
dispatcher.executeDispatch(oFrame, ".uno:OptionsTreeDialog", "", 0, Array())


If I understand correctly, the "uno:InsertObject" and
"uno:OptionsTreeDialog" are the "names" of the objectes or windows to
interact with. Right?
How could I find the "name" of the "Modify links" window?   (Menu Edit /
Links...)

And that is just the beginning.


Thank you very, very much for your help.

Ely.



>
> --
> Andrew Pitonyak
> My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
> My Book: http://www.hentzenwerke.com/catalog/oome.htm
> Info:  http://www.pitonyak.org/oo.php
> See Also: http://documentation.openoffice.org/HOW_TO/index.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

P.S. Here I put the functions I used for testing:

Function fTestLinkMode
    Dim oSheet as Object
    oSheet = ThisComponent.Sheets.getByIndex(0)
    fTestLinkMode = "=> " &  oSheet.Name & " **LinkMode: " &
oSheet.getLinkMode()
End function

Function fTestLinkUrl
    Dim oSheet as Object
    oSheet = ThisComponent.Sheets.getByIndex(0)
    fTestLinkUrl = "=> " &  oSheet.Name & " **LinkUrl: " &
oSheet.getLinkUrl()
End function

Function fTestSetLinkMode(pMode)
    Dim oSheet as Object
    oSheet = ThisComponent.Sheets.getByIndex(0)
    '#oSheet.setLinkMode(com.sun.star.sheet.SheetLinkMode.NONE)
    oSheet.setLinkMode(pMode)
    fTestSetLinkMode = "=> " & "done"
End function

Reply via email to