• 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: Making text plain or bold in Word
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Making text plain or bold in Word


  • Subject: RE: Making text plain or bold in Word
  • From: "Frank W. Walker" <email@hidden>
  • Date: Mon, 14 Apr 2003 16:11:04 -0400
  • Thread-topic: Making text plain or bold in Word

Tried Shane's script and it works pretty well, but a couple of quirks.
Looks like Word is counting spaces as words so I have to set the number of words to 3 to get it to change 2 words.
Also, a "/" character throws off the count as well.

I put in an if/then to check for slashes, so here is what I came up with by trial and error, which I'll probably refine later.

set style of text of document 1 to plain
if word 3 of document 1 is "/" then
set wordnumber to 4
else if word 4 of document 1 is "/" then
set wordnumber to 5
else
set wordnumber to 3
end if
set style of text from word 1 to word wordnumber of document 1 to bold

Thanks for all the help and ideas! This list is awsome!

Frank
> ----------
> From: Shane Stanley
> Sent: Friday, April 11, 2003 7:34 PM
> To: AS lists
> Subject: Re: Making text plain or bold in Word
>
> On 12/4/03 2:56 AM +1000, Frank W. Walker, email@hidden, wrote:
>
> > All I want to do is change all text in an opened Word document to "plain",
> > then change the first two words of text to "bold".
> >
> > Easy, I hope?
>
> In AppleScript, you could try something like this:
>
> tell application "Microsoft Word"
> set style of text of document 1 to plain
> set style of text from word 1 to word 2 of document 1 to bold
> end tell
>
> Works here in Word 98.
>
> --
> Shane Stanley, email@hidden
> _______________________________________________
> applescript-users mailing list | email@hidden
> Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: newbie( Mail App)
  • Next by Date: Re: newbie( Mail App)
  • Previous by thread: Re: Making text plain or bold in Word
  • Next by thread: OS X 10.2.5 and AppleScript
  • Index(es):
    • Date
    • Thread