Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Paste Time Only

Description
Takes a date time value and pastes only the time. The original date time value stays on the clipboard.
Language
VB.net
Minimum Version
Created By
wooster11
Contributors
-
Date Created
Aug 19, 2014
Date Last Modified
Aug 19, 2014

Macro Code

Imports System
Imports System.Windows.Forms
Imports Microsoft.VisualBasic

Public Class ClipboardFusionHelper

    Public Shared Function ProcessText(text As String) As String
        If IsDate(text) Then
          Dim x As DateTime = CDate(text)
            BFS.Clipboard.PasteText(x.ToString("hh:mm:ss tt"))
        Else
          MessageBox.Show("Clipboard text is invalid.  It must be a date", "Paste Time Only", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If

        Return text
    End Function

End Class