PDA

View Full Version : Opening Microsoft Word docs to specific page



Philo
02-12-2004, 05:03 AM
Hello

I have used an older AMS package (v3 i think) to create an interface for a large Microsoft Word document.
The problem I had was opening to a specific page in the document. To resolve it I broke the document down in lots of smaller documents which was a pain in the neck.

Will the new version of AMS (5.0) allow me to open to a specific page in a .doc file? If not I noticed there is a plugin available to allow manipulation of COM objects. Would this allow me to do it? If so how hard would it be?

Phil

Brett
02-12-2004, 07:05 AM
I am not an expert with Word automation, but here is a start:


ms_word = luacom.CreateObject("Word.Application");
if( not ms_word)then
Dialog.Message("Error","Failed to create Word Document");
else
ms_word.Visible = true;
ms_word.Documents:Open("C:\\myDocument.doc");
-- Uncomment next line to close Word
-- ms_word:Quit();
ms_word = nil;
end

Philo
02-12-2004, 09:28 AM
Thanks for the quick reply

I will give it a go.