0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

クリップボードの文字列をカナにして戻すVBScript(要Excel)

Posted at
'// GetPhoneticStr.vbs

txt = GetClipBoardText
CopyToClipboard(GetPhoneticStr(txt))

MsgBox "以下の文字列をカナにしてクリップボードに戻しました。" & vbCrLf & vbCrLf & txt
'// カナを返す

Function GetPhoneticStr(str)

    GetPhoneticStr = CreateObject("Excel.Application").GetPhonetic(str)

End function
'// クリップボードのテキストを取り出す
 
Function GetClipBoardText()

    GetClipBoardText = Trim(CreateObject("htmlfile").ParentWindow.ClipboardData.GetData("text"))

End Function
'// テキストをクリップボードにコピーする
'// 一瞬コンソール画面が出る

Sub CopyToClipboard(txt)

    CreateObject("WScript.Shell").Exec("clip").StdIn.Write(txt)

End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?