Microsoft Word, Office 2008, working with pages / delete pages

Hi there

First of all I’d like to thank the Administrator of this Forum and all it’s members.
I’ve been working on an AppleScript project for a while now and this site has been a huge help in learning AppleScript and solving ton’s of problems I’ve crossed along the way.

Anyways - I’m kinda stuck here. Can someone help me on deleting pages out of a word document (I’m using Office 2008, it’s AppleScript library is similar to that of Office 2004)?
There is no “page” object in the MS word reference, so I don’t know how I should go about deleting pages.

Thanks for any help.

Chris

Hi phore,

A while back I ran into a similar problem when scripting the Microsoft Office suite and unfortunately I did not find a solution. Microsoft Word is a word processor, not a page based layout application like InDesign, Quark (and RagTime). I guess that is why there is no «page object» available in Word’s AppleScript dictionary.

When you are working in Word, you are adding and removing text, and the pages are deleted and added automatically for you (of course you can enter section breaks). So the «text object» is very powerful in Word. But I was not able to delete single pages from a Word document with AppleScript.

Even in the Windows world, which uses Visual Basic for Word automation, this problem is well known:

Q: Delete Pages Using VBA in Word?
A: Word does not make this easy, for good reason. What’s a page, anyway?

Yes, I can see how that makes sense.
The application converts xls/ppt/doc files to PDF, you can combine multiple files and filetypes. I wanted to be able to add page ranges too,
but I guess that doesn’t really makes sense for text documents. I’ll just support that feature for xls&ppt then.

Thank you for your answer Martin.