• 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
Word Document Page setup scripting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Word Document Page setup scripting?


  • Subject: Word Document Page setup scripting?
  • From: Tod Hallberg <email@hidden>
  • Date: Fri, 07 Oct 2005 08:27:59 -0500
  • Thread-topic: Word Document Page setup scripting?

I am trying to script the page setup and layout of a text document.

I would like to have the page layout to be landscape.
I would like to have margins of : Top 1 inch, bottom .5 inch, left .5 inch,
right .5 inch.

Here is what I have so far:

set myDoc to (choose file) as alias
tell application "Microsoft Word"
    run
end tell

tell application "Microsoft Word"
    open myDoc
    activate
    if (count of documents) „ 1 then
        set myOpenDoc to (get name of active document)
    else
        display dialog "No documents are open"
    end if
    activate object document myOpenDoc
    --*)

    set topMargin to "1"
    set bottomMargin to ".5"
    set rightMargin to ".5"
    set leftMargin to ".5"

    set top margin of document myOpenDoc to inches to points inches
topMargin
    set bottom margin of document myOpenDoc to inches to points inches
bottomMargin
    set right margin of document myOpenDoc to inches to points inches
rightMargin
    set left margin of document myOpenDoc to inches to points inches
leftMargin

end tell

I get an error of can't set margin to 72 when it gets to the Top margin
line.

Any help would be greatly appreciated

Thanx

Tod


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: X-Code 1.5 oddity
  • Next by Date: Re: To Matt: Problem Sending AppleScripts as Text: The Resource Fork
  • Previous by thread: Word Document Page setup scripting?
  • Next by thread: To Matt: Problem Sending AppleScripts as Text: The Resource Fork
  • Index(es):
    • Date
    • Thread