logo       

Re: Word Macro: msg#00012

linux.hardware.sony.librie

Subject: Re: Word Macro

Where is the Word Macro located?

--- In librie@xxxxxxxxxxxxxxx, Michael Washington <michaelwa@...> wrote:
>
> Someone published a Microsoft Word Macro to format text documents for
> the Sony E-Reader. I took the macro and recreated it in Applescript
> so you can use it to format documents in Microsoft Word 2004 for OSX.
>
> tell application "Microsoft Word"
> (* Select the entire contents of the active document *)
> set myrange to text object of active document
> select myrange
> (* clear formatting of document and set desired font properties *)
> clear formatting of selection
> set myfontobject to font object of myrange
> tell myfontobject
> set name to "Times New Roman"
> set font size to "14"
> set ascii name to "Times New Roman"
> set other name to "Times New Roman"
> set bold to "False"
> set italic to "False"
> end tell
>
> set selFind to find object of myrange
> set forward of selFind to true
> set format of selFind to false
> set match case of selFind to false
> set match whole word of selFind to false
> set match byte of selFind to false
> set match wildcards of selFind to false
> set match sounds like of selFind to false
> set match all word forms of selFind to false
> set wrap of selFind to find continue
> (* This step replaces hard page breaks *)
> tell selFind
> set content to "^m"
> set content of replacement of selFind to ""
> execute find wrap find find continue replace replace all with
> match
> forward
> end tell
> (* This step replaces the correct paragraph mark with a temporary
> sign "#*#", if your document has that sign, replace it with some
> other special character. *)
> tell selFind
> set content to "^p^p"
> set content of replacement of selFind to "#*#"
> execute find wrap find find continue replace replace all with
> match
> forward
> end tell
> (* This step will replace the inappropriate line break with a space. *)
> tell selFind
> set content to "^p"
> set content of replacement of selFind to " " (* if there is a
> space
> at the end of the line change this to "" *)
> execute find wrap find find continue replace replace all with
> match
> forward
> end tell
> (* This step will return the paragraph break to normal *)
> tell selFind
> set content to "#*#"
> set content of replacement of selFind to "^p^p"
> execute find wrap find find continue replace replace all with
> match
> forward
> end tell
>
>
> end tell
>




------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/hOt0.A/lOaOAA/yQLSAA/GE2qlB/TM
--------------------------------------------------------------------~->




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise