Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <Title>MY NOTEPAD DIARY BY © NAJEEB © 2021 </Title>
- <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
- <head>
- <HTA:APPLICATION
- ICON="Notepad.exe"
- APPLICATIONNAME = "Save file into noteapd and Word Application"
- BORDER="dialog"
- BORDERSTYLE="complex"
- >
- </head>
- <script type="text/Vbscript">
- '*****************************************************
- Sub window_onload()
- CenterWindow 600,500
- End Sub
- '*****************************************************
- Sub CenterWindow(x,y)
- Dim iLeft,itop
- window.resizeTo x,y
- iLeft = window.screen.availWidth/2 - x/2
- itop = window.screen.availHeight/2 - y/2
- window.moveTo ileft,itop
- End Sub
- '*****************************************************
- Sub Save2Notepad()
- 'Save into a Notepad Document
- Title = "Data saved into Notepad Appplication"
- Set fso = CreateObject("Scripting.FileSystemObject")
- FileTxt = "FILE_" & Month(Date) & "_" & Day(Date) & "_" & Year(Date) & ".txt"
- Txtareah = document.all("Txtareah").Value
- Txtarea = document.all("Txtarea").Value
- Set oFile = fso.OpenTextFile(FileTxt,8,true)
- sTxtareah = document.all("Txtareah").Value
- sTxtarea = document.all("Txtarea").Value
- oFIle.Writeline
- oFIle.Write (" **************************START*************************** ")
- oFIle.write vbCrLf
- oFIle.write ("© NAJEEB © ")
- oFIle.write FormatDateTime(now, 2)
- oFIle.write (" ")
- oFIle.write FormatDateTime(now,vbLongTime)
- 'FormatDateTime(now, 4)
- oFIle.write (" <-- HEADING --> ")
- oFIle.Write sTxtareah & vbCrLf
- oFIle.write vbCrLf
- oFIle.Write sTxtarea & vbCrLf
- oFIle.Write (" **************************END*************************** ")
- oFIle.WriteLine ReadAllTextFile
- oFile.Close
- MsgBox "Data saved into : " & FileTxt,vbInformation,Title
- End Sub
- '*****************************************************
- </script>
- <body>
- <center>
- <form>
- Enter Your Heading:-
- <textarea ID="Txtareah" NAME="Txtareah" cols="20" rows="1"></textarea>
- <br>
- <textarea ID="Txtarea" NAME="Txtarea" cols="65" rows="20"></textarea>
- <hr>
- <input type="button" value="save into notepad" onClick="Save2Notepad()"/>
- <hr>
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement