'-------------------------------------------------------------------------------
'新規メモの作成マクロ
'
' CopyRight Naoshi Ide 2015-
'-------------------------------------------------------------------------------
Call Main
'メイン処理
Sub Main()
Dim memofolder
Dim strDate
Dim memoFileName
Dim memoFileObj
memofolder = "C:\Users\Nao\Documents\個人フォルダ\10.メモ\"
strDate = Date
strDate = Replace(strDate, "/", "")
text = InputBox("メモのタイトルを入力してください","memo")
If text="" then
Exit Sub
End If
memoFileName = memoFolder & strDate & "_" & text & ".memo"
'ファイルの新規作成
Dim objFileSys
Set objFileSys = CreateObject("Scripting.FileSystemObject")
objFileSys.CreateTextFile memoFileName
Set memoFileObj = objFileSys.OpenTextFile(memoFileName, 2, True)
memoFileObj.WriteLine("■" + text)
memoFileObj.Close
FileOpen(memoFileName)
End Sub
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme