'変更項目↓ strUserNameT = "userid" 'TimelogユーザID strPassWordT = "password" 'Timelogパスワード strText = "テスト書き込み" '書き込む内容 '変更項目↑ここまで strURLT = "http://api.timelog.jp/new.asp" blCheck = False '書き込み前に確認するか?(True:する False:しない) Set regEx = New RegExp ' 文字列検索・置換用オブジェクトの作成 regEx.Global = True ' 文字列全体を検索するように指定 ' 特殊文字を全角に変換(テキスト中に"があると誤動作するため) regEx.Pattern = """" strText = regEx.Replace(strText, "”") If blCheck Then Set shell = WScript.CreateObject("WScript.Shell") strText = InputBox("この内容で投稿しますか?","投稿確認",strText) End If ' Timelog特殊文字を全角に変換 regEx.Pattern = "@" strText = regEx.Replace(strText, "@") regEx.Pattern = "\[" strText = regEx.Replace(strText, "[") regEx.Pattern = "\]" strText = regEx.Replace(strText, "]") 'Timelog----------------------------------------- ' 新しいメモの投稿(Timelog) Set xmlReq = CreateObject("Microsoft.XMLHTTP") xmlReq.Open "POST", strURLT, False, strUserNameT, strPassWordT xmlReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" xmlReq.setRequestHeader "User-Agent", "Mes_Post" ' Timelog Post If Not isnull(strText) Then If strText <> "" Then On Error Resume Next Set sc = CreateObject("ScriptControl") sc.Language = "Jscript" Set js = sc.CodeObject xmlReq.send("text=" & js.encodeURIComponent(strText)) Select Case Err.Number Case 0 'WScript.Echo "OK!^^;" Case Else WScript.Echo "Timelog NG!><;" & Err.Number & ":" & Err.Description End Select Else WScript.Echo "Cancel!" End If Else Wscript.Echo "Null!" End If Set xmlReq = Nothing Set regEx = Nothing