Need help with a Word script
Need help with a Word script
- Subject: Need help with a Word script
- From: email@hidden
- Date: Sun, 9 Aug 2009 19:25:48 +0000 (UTC)
Hi
I'm writing a script to extract format names, style and text from a Word document and package it up into another file sans all the junk Microsoft packs into a word file. I'm able to get the paragraphs and their styles, but can't figure out how to get style ranges within a paragraph. For example say an editor chooses a style for a paragraph and then bolds various words within that paragraph, how would I go about getting these ranges and the style associated with them?
I already tried using the "range" and "text range" keywords but all they return is empty lists. Here's what I have so far
tell application "Microsoft Word"
tell document 1
set paragraphList to paragraphs
set resultList to "<v7.31><e9>" & return
repeat with aPara in paragraphList
tell aPara
set paraStyle to style
set paraText to content of text object
end tell
-- would like to get the bold, italic, pointsize change etc rangesĀ
-- and loop through those as well, but no luck so fat
set resultList to resultList & "@" & paraStyle & ":" & paraText
end repeat
end tell
end tell
Does anyone know how I could get these ranges, or if it's even possible?
Thanks for any help
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden