![]() |
#6
|
||||
|
||||
![]()
Have a look at this page for clues on using Shell commands in a vba macro. https://www.myonlinetraininghub.com/vba-shell#:~:text=The VBA Shell function runs, known as the Command Prompt.
As for getting the contents of a cell into the macro you create, I would supply the text in a macrobutton by pressing Ctrl-F9 to create a field and then type this inside those braces { MacroButton PlayVLC C:\test1.mp3 33.4 } You can then press F9 to show the result and double click it to run the macro. A macro that works by being kicked off by such a macrobutton should work along these lines. Note that I don't have VLC player on my machine so I can't fully test that your syntax works. Code:
Sub PlayVLC() Dim sCmd As String, sArray() As String, vShell sArray = Split(Trim(Selection.Fields(1).Code), " ") Debug.Print sArray(3), sArray(2) sCmd = """C:\Program Files\VideoLAN\VLC\vlc""" & " --start-time=" & sArray(3) & " " & sArray(2) Debug.Print sCmd vShell = Shell(sCmd, vbNormalFocus) End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Playing an audio file from word | RRB | Word | 1 | 05-10-2021 03:13 AM |
audio stops playing after i view the presentation once | Purnima | PowerPoint | 0 | 05-28-2018 02:16 AM |
![]() |
pixeltaker | PowerPoint | 1 | 09-10-2015 08:27 PM |
Playing only a part of a big audio file with the Hipertextual link | cethai | Word | 4 | 01-03-2015 06:12 AM |
![]() |
TJSNO | PowerPoint | 5 | 12-10-2011 12:01 PM |