Advertisement
Najeebsk

NOTEPAD DIARY.hta

Nov 29th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.16 KB | None | 0 0
  1. <html>
  2. <Title>MY NOTEPAD DIARY BY © NAJEEB © 2021 </Title>
  3. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
  4. <head>
  5. <HTA:APPLICATION
  6. ICON="Notepad.exe"
  7. APPLICATIONNAME = "Save file into noteapd and Word Application"
  8. BORDER="dialog"
  9. BORDERSTYLE="complex"
  10. >
  11. </head>
  12. <script type="text/Vbscript">
  13. '*****************************************************
  14. Sub window_onload()
  15.     CenterWindow 600,500
  16. End Sub
  17. '*****************************************************
  18. Sub CenterWindow(x,y)
  19.     Dim iLeft,itop
  20.     window.resizeTo x,y
  21.     iLeft = window.screen.availWidth/2 - x/2
  22.     itop = window.screen.availHeight/2 - y/2
  23.     window.moveTo ileft,itop
  24. End Sub
  25. '*****************************************************
  26. Sub Save2Notepad()
  27. 'Save into a Notepad Document
  28. Title = "Data saved into Notepad Appplication"
  29. Set fso = CreateObject("Scripting.FileSystemObject")
  30. FileTxt = "FILE_" & Month(Date) & "_" & Day(Date) & "_" & Year(Date) & ".txt"
  31. Txtareah = document.all("Txtareah").Value
  32. Txtarea = document.all("Txtarea").Value
  33. Set oFile = fso.OpenTextFile(FileTxt,8,true)
  34. sTxtareah = document.all("Txtareah").Value
  35. sTxtarea = document.all("Txtarea").Value
  36.    oFIle.Writeline
  37.    oFIle.Write (" **************************START*************************** ")
  38.    oFIle.write vbCrLf
  39.    oFIle.write ("© NAJEEB © ")
  40.    oFIle.write FormatDateTime(now, 2)
  41.    oFIle.write (" ")
  42.    oFIle.write FormatDateTime(now,vbLongTime)
  43.    'FormatDateTime(now, 4)
  44.    oFIle.write (" <-- HEADING --> ")
  45.    oFIle.Write sTxtareah & vbCrLf
  46.    oFIle.write vbCrLf
  47.    oFIle.Write sTxtarea & vbCrLf
  48.    oFIle.Write (" **************************END*************************** ")
  49.    oFIle.WriteLine ReadAllTextFile
  50.    oFile.Close
  51. MsgBox "Data saved into : " & FileTxt,vbInformation,Title
  52. End Sub
  53. '*****************************************************
  54. </script>
  55. <body>
  56. <center>
  57. <form>
  58. Enter Your Heading:-
  59. <textarea ID="Txtareah" NAME="Txtareah" cols="20" rows="1"></textarea>
  60. <br>
  61. <textarea ID="Txtarea" NAME="Txtarea" cols="65" rows="20"></textarea>
  62. <hr>
  63. <input type="button" value="save into notepad" onClick="Save2Notepad()"/>
  64. <hr>
  65. </form>
  66. </center>
  67. </body>
  68. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement