Date: prev next · Thread: first prev next last
June 2020 Archives by date, by thread · List index


https://bugs.documentfoundation.org/show_bug.cgi?id=133585

--- Comment #13 from Heiko Tietze <heiko.tietze@documentfoundation.org> ---
(In reply to neil from comment #11)
Can you tell me if I could build a macro to do this.

With pleasure. Took this as example
https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=57699#

Sub Main
  oSounMgr = CreateUnoService("com.sun.star.comp.media.Manager_GStreamer")
  If NOT IsNull(oSounMgr) Then
    oSfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")
    sBaseURL = CreateUnoService("com.sun.star.util.PathSubstitution")._
        substituteVariables("$(inst)/share/gallery/sounds", True)

    sSound1 = sBaseURL & "/ok.wav"
    If oSfa.exists(sSound1) Then
      oPlayer1 = oSounMgr.createPlayer(sSound1)
      oPlayer1.setPlaybackLoop(False)
      oPlayer1.start()
      while oPlayer1.isplaying()
        doevents
      wend 
    End If
  End If
End Sub

Use Tools > Customize > Events to bind save to this macro.

(In reply to neil from comment #11)
Know anywhere I could look online?

We have some guides for macros [1], some more information [2], and formed a
help team recently [3]. And questions like this are also well suited for
ask.libreoffice.org. 

[1] https://documentation.libreoffice.org/en/english-documentation/macro/
[2] https://wiki.documentfoundation.org/Macros
[3]
https://blog.documentfoundation.org/blog/2020/04/08/libreoffice-macro-team-progress-report-2/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.