Hello to you all,
I'm trying to start with word automation. Now I've the some questions. This is the code I'm using within a class:
// Is Word actif or should it be started.
:m_oWordObject=GetActiveObject("Word.Application")
IF :m_oWordObject=Null THEN
// Word needs to be started.
:m_oWordObject=new object OLE "Word.Application"
END
:m_sDocumentName="C:\Temp\MyDocument.doc"
:m_oWordObject>>Documents>>Open(:m_sDocumentName,OLEFalse,OLEFalse)
Info("Now my document is loaded")
When I start Word at this moment and open some other documents, the active document is changed.
When I return to my program and I want to close my original document, how can I make that document the active one. I know I can do something like:
:m_oWordObject>>Windows(
1)>>Activate
but I don't know what number it is. So I've tried with ':m_oWordObject>>Windows(
:m_sDocumentName)>>Activate' but that didn't work as well.
Can anybody tell me how I can make my own document the active one, or how I should do this another way.
The second question I want to ask is: how can I retrieve the number of opened documents in Word.
I found this one: :m_oWordObject>>Documents>>Count
Edited 1 time(s). Last edit at 04/09/2009 07:01PM by Louis Verbraak.