![]() ![]() To create a table in a word document, things get more complicated, though. SetContentInActiveWordDocument("the new text") // replaces the text in the opened word file You can now call this SetContentInActiveWordDocument like a function, passing a String to it.Į.g, write: eFile.Launch() // this should open an existing word file if it exists in "eFile" Then drag this script file into your REALbasic project, it'll appear as an item named "SetContentInActiveWordDocument" in italics. ![]() Save it as a script file (file extension. ![]() Set content of text object of d to newContent Now, to use this with REALbasic, create this script: on run Do learn how to add text to existing text or to change fonts etc, you need to read the "Dictionary" of Word, which you can open in the AppleScript Editor, see the File menu. That's the basics to read and write text in Word via Applescript. Set content of text object of d to "new text" In the same way you can alter the text in the Word document: tell application "Microsoft Word" If you have a text document open in Word, and then you run this script, it should print the plain text of it in the Result pane below the script code. ![]() Get a little acquainted with the app "AppleScript Editor".Įnter the following script into a new script window: tell application "Microsoft Word" Here's more details on how to do this for Mac OS X: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |