Dear Rony,
as you asked, I will send you the 2 ideas that Milos and I had and how we realized it:
The first one was: a code for a random inspirational message in word and after a note on Notepad as well with the message "How do you feel?" after the inspirational message.
When you run it in tryrexx in virtual pc, it creates a doc in PC/Documents with a random name and inspirational message and a note on Notepad.
/* Array of random funny names */
names = .array~of("Goofy McGoofface", "Wacky Willy", "Silly Sally", "Jokester Joe", "Quirky Quinn")
/* Array of random funny messages */
messages = .array~of("Wishing you a day full of smiles!", "Stay quirky, it suits you!", "You're a joy to be around!", "Keep spreading the laughter!", "You're one of a kind, and that's awesome!")
/* Pick a random name and message */
nameIndex = random(1, names~size)
msgIndex = random(1, messages~size)
name = names[nameIndex]
msg = messages[msgIndex]
/* Create the greeting */
greeting = "Hey " || name || "!"
/* Create an OLE object for Word */
wordObj = .OLEObject~new("Word.Application")
wordObj~Visible = 1
/* Create a new document */
doc = wordObj~Documents~Add()
selection = wordObj~Selection
/* Add Greeting Text */
selection~TypeText(greeting)
selection~ParagraphFormat~Alignment = 1 /* Center alignment */
selection~Font~Size = 36
selection~Font~Bold = 1
/* Add Message Text */
selection~TypeParagraph()
selection~TypeText(msg)
selection~Font~Size = 24
selection~Font~Italic = 1
/* Save the document */
doc~SaveAs("Funny_Greeting_Card.docx")
/* Create another OLE object */
shellObj = .OLEObject~new("WScript.Shell")
shellObj~Run("notepad.exe")
/* Pause briefly to ensure Notepad is open before sending keys */
call SysSleep 1
/* Write text in Notepad */
shellObj~SendKeys("How do you feel in the moment?")
/* Clean up */
wordObj~Quit()
The second one arrives with the next e-mail.
Cheers!
Milos and Giorgia