• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Scripting in Word using Styles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting in Word using Styles


  • Subject: Re: Scripting in Word using Styles
  • From: Allen Watson <email@hidden>
  • Date: Wed, 26 Dec 2001 09:31:27 -0800

On Sun, 23 Dec 2001 03:40:56 -0500 Rich Fortnum <email@hidden> wrote:

> How do you script the following:
>
> Set myText to "blah blah blah"
> Set contents of selection to myText
> Make characters of paragraph 1 with properties {bold, italic, size 18}
>
> Trying to script multiple entries and have some style to the text. Or, how
> can I define styles and have them turn on and off? Just don't know the
> syntax.
>
What follows is a chunk of code from a working script that takes multiple
mail messages from Entourage and creates a Word document with them appended
one after another. It should give you the clues you need:


tell application "Microsoft Word"
if firstMessage then
make new document
set size of paragraph style "Normal" to 10
set font of paragraph style "Normal" to "Courier"
set first line indent of paragraph style "Normal" to 0
copy ("CONSOLIDATED MAIL MESSAGES FROM" & return & "FOLDER: " &
theFolder & ,
return & (current date) as string) & return to end of
document 1
set paragraph style of selection to "Normal"
set contents of selection to theText & divider
set firstMessage to false
else
copy "Folder: " & theFolder & return & theText & divider to end
of document 1
end if
end tell


  • Prev by Date: Re: how to hide the frontmost app?
  • Next by Date: Re: Getting keyboard status in X
  • Previous by thread: Scripting in Word using Styles
  • Next by thread: 9.2.2: UI lookup fixed in AS 1.7
  • Index(es):
    • Date
    • Thread