Word

Show Now Playing Winamp title in application caption

Ease of Use

Intermediate

Version tested with

2003 

Submitted by:

lynnnow

Description:

This code displays the now playing song/title in the application's caption. 

Discussion:

This macro can be put in the Normal.dot file to run automatically when MS Word is launched. If you use Winamp to listen to songs, either online radio or music from your library, and want to know which song is currently playing, the MS Word application caption gets appended with the title of the song playing. The macro is rerun at specific intervals (user-defined) to refresh the application caption. 

Code:

instructions for use

			

'In ThisDocument module Private Sub Document_Open() Application.Run "ShowWinampWindow" End Sub 'Module Code Option Explicit Sub ShowWinampWindow() Dim AppCap As String Dim Task1 On Error Resume Next For Each Task1 In Tasks If Right(Task1.Name, 6) = "Winamp" Then Application.Caption = "" AppCap = Application.Caption & " " & _ Mid(Task1.Name, 3, InStr(1, Task1.Name, "Winamp", vbTextCompare)) Application.Caption = Left(AppCap, Len(AppCap) - 6) End If Next Task1 Application.OnTime When:=Now + TimeValue("00:00:03"), _ Name:="ShowWinampWindow" 'Change this to suit your refresh time. End Sub

How to use:

  1. 1. Copy the code above.
  2. 2. Open your document.
  3. 3. Hit Alt+F11 to open the Visual Basic Editor (VBE).
  4. 4. From the menu, choose Insert-Module.
  5. 5. Paste the code into the code window at right.
  6. 6. Close the VBE and save the file if desired.
 

Test the code:

  1. 1. Save and close the Normal.dot file when prompted and exit MS Word.
  2. 2. When a MS Word is restarted, the code will execute automatically.
 

Sample File:

Show Winamp Title.zip 5.39KB 

Approved by Jacob Hilderbrand


This entry has been viewed 73 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express