On Sat, 2006-07-22 at 10:25 -0400, Bill Chmura wrote:
> On Sat, 22 Jul 2006 07:39:49 -0400
> "G. Roderick Singleton" <[EMAIL PROTECTED]> spake:
> > [whole bunch snipped]
> > 
> > No VBA was included.  So GetZip and GetAddress are not there for
> > analysis or recommendation on how to translate them. If it will help get
> > everything into OOo, have a look at
> > http://documentation.openoffice.org/HOW_TO/various_topics/VbaStarBasicXref.pdf
> >  and it companion example file.
> > 
> > So, I think I interpret your original question as that you want the
> > hyperlinks in a database of sorts. So now that I have the example, I
> > will see if there is a solution that I can find. May take a bit so be
> > patient. One other thing, do you care which database? I have Base,
> > Mysql, Postgres and Oracle with which to play.
> > 
> > > Thanks for any help...
> > > 
> > > Basically oocalc just errors on every time the function is called in
> > > the sheet.
> > > 
> > 
> > Not surprized about the VB failing. Remember OOo uses OOoBASIC and
> > therefore any macros need some recoding.  Staroffice may have a VB
> > migration tool if you are in a hurry.
> > 
> 
> Not sure about the VBA... that is the same copy that I load in Excel
> and it works.  I think the VBA may have been in a module attached to
> the sheet - not sure if that helps.  
> 
> All I need is a way to export the hyperlinks (not the "hypertext") into
> CSV.  From there I have a bunch of preprocessing in perl to do.  If you
> can get me that far, I'd be sure to put you on the christmas card and
> unwanted fruitcake list for this year :)

I think I mentioned this before, OOo will _NOT_ give you the hyperlinks
in cvs. 

> 
> I'll also take a look through the docs you pointed out
> 

I have spent some time this weekend examining your problem and think the
best way might be a macro to extract the URLS. Here is one cobbled
together for you to try. It is untested so use only on a copy of
the .ods file you create from your original.


open Tools>Macros>Organize Macros
Select OpenOffice BASIC
Select library "Standard" in container "my Macros" 
Button "New..." 
Accept default name "Module1" or something alike 
Button "Edit"

Put the following into or replace what is there:

sub extract_1st_HyperlinkURL_to_RightNeighbour 
   with thiscomponent.currentcontroller.selection 
      oSheet = .SpreadSheet 
      oEnum
= 
.queryContentCells(com.sun.star.sheet.CellFlags.STRING).getCells.createEnumeration
 
   end with 
   while oEnum.hasMoreElements 
      oSourceCell = oEnum.NextElement 
      oTargetAddr = oSourceCell.CellAddress 
      oTargetCell =
oSheet.getCellByPosition(oSourceCell.CellAddress.Column
+1,oSourceCell.CellAddress.Row) 
      if oSourceCell.Textfields.Count >0 then 
         URL = oSourceCell.Textfields.getByIndex(0).URL 
         oTargetCell.setString(URL) 
      endif 
   wend 
end Sub

I am no a macro coder so this assumes that the spreadsheet has an empty
column to the right of the column with the linked text into which the
macro can place the URL. Please have a look at the HYPERLINK function as
well just in case you need it.
-- 
PLEASE KEEP MESSAGES ON THE LIST.
OpenOffice.org Documentation Co-Lead
http://documentation.openoffice.org/ 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to