Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, April 2007
Does Qt support automating Microsoft Office?


Message 1 in thread

Does Qt support automating Microsoft Office?

I know Visual Basic(VB) and Visual C++(MFC) or .net can do this job to 
automate any Microsoft Office stuff (Word, PowerPoint . . .) in Windows. 
Can Qt handle this? Any examples?

Lingfa


--
 [ signature omitted ] 

Message 2 in thread

Look at the documentation on ActiveQT.
This should show you how to automate any applications that support ActiveX.

Karl

-----Original Message-----
From: Lingfa Yang [mailto:lingfa@xxxxxxx] 
Sent: Thursday, April 12, 2007 8:47 AM
To: Qt Interest
Subject: Does Qt support automating Microsoft Office?

Does Qt support automating Microsoft Office?

I know Visual Basic(VB) and Visual C++(MFC) or .net can do this job to 
automate any Microsoft Office stuff (Word, PowerPoint . . .) in Windows. 
Can Qt handle this? Any examples?

Lingfa


--
 [ signature omitted ] 

Message 3 in thread

Karl Ruetz wrote:

>Look at the documentation on ActiveQT.
>This should show you how to automate any applications that support ActiveX.
>
>Karl
>
>  
>
Thanks, Karl

What "automating MS applications" means in Qt development environment
how to open PowerPoint application, for instance,
how to insert an ActiveX control to the ppt application, and
how to initialize the ActiveX control if the control has persistent data 
requirement.

The Qt documentation tells only how to generate ActiveX controls --- 
this is not "automation” jobs I mentioned.

Thanks again for any further thinking.
Lingfa


--
 [ signature omitted ] 

Message 4 in thread

Lingfa Yang schrieb:
> Karl Ruetz wrote:
> 
>> Look at the documentation on ActiveQT.
>> This should show you how to automate any applications that support
>> ActiveX.
>>
>> Karl
>>
>>  
>>
> Thanks, Karl
> 
> What "automating MS applications" means in Qt development environment
> how to open PowerPoint application, for instance,

See QProcess.

> how to insert an ActiveX control to the ppt application, and

Refer to the PowerPoint application API documentation.

> how to initialize the ActiveX control if the control has persistent data
> requirement.

Refer to the Win32 SDK (ActiveX) documentation, e.g. MSDN.
> 
> The Qt documentation tells only how to generate ActiveX controls ---

If that does not help you, then you need to dig into the mentioned APIs
(off-topic here).

> this is not "automation” jobs I mentioned.

I didn't find any good definiton with google what an "automation job"
(in the context of software engineering) is - maybe you can further
explain what you mean? I don't see any "automation" in the points you've
mentioned above ;)

> 
> Thanks again for any further thinking.

You're welcome :)

Cheers, Oliver

--
 [ signature omitted ] 

Message 5 in thread

>>this is not "automation” jobs I mentioned.
>>    
>>
>
>I didn't find any good definiton with google what an "automation job"
>(in the context of software engineering) is - maybe you can further
>explain what you mean? I don't see any "automation" in the points you've
>mentioned above ;)
>
>  
>
Thanks Oliver for your detailed suggestions.

With Automation, you can control the Visual C++ environment from other 
applications such as Word, Excel, or Visual Basic. You can start Visual 
C++, automate tasks, and then stop Visual C++ when the tasks are finished.
http://msdn2.microsoft.com/en-us/library/aa232464(VS.60).aspx

How to automate PowerPoint by using Visual Basic in Office 2003
http://support.microsoft.com/kb/222929

Using ActiveX Controls to Automate Your Web Pages
http://msdn.microsoft.com/workshop/components/activex/tutorial.asp

Automating Microsoft Office 97 and Microsoft Office 2000
http://msdn2.microsoft.com/en-us/library/aa155776(office.10).aspx


--
 [ signature omitted ] 

Message 6 in thread

Lingfa Yang schrieb:
> 
>>> this is not "automation” jobs I mentioned.
>> ...
> With Automation, you can control the Visual C++ environment from other
> applications such as Word, Excel, or Visual Basic. You can start Visual
>...
> [links to MS resource sites]

Qt being a cross-platform toolkit does not offer much platform-specific
support, and for sure not direct MS Office support.

ActiveQt is one of the exceptions which supports platform-specific
technology (D-Bus support on Unix (Mac?) being another example). This is
all that Qt offers which comes closest to what you need (starting a
simple application such as PowerPoint with arguments etc. you would
still use QProcess ;)

If this ActiveQt framework is not enough for your task to interface the
specific Microsoft APIs (which I'm sure are mentioned in the links
you've posted) then you have to find some other (direct) way to
incorporate "automation" into your application, read: use the Microsoft
APIs directly (or via ActiveQt if this seems reasonable).

As long as Microsoft offers a proper C++ API for this "Office,
PowerPoint etc. "automation" then there should be no problem to
incorporate this into your C++ application, no? But this is becoming
off-topic here...

Cheers, Oliver

p.s. Don't write to me in private, I'm on the list

--
 [ signature omitted ] 

Message 7 in thread

On 13.04.07 10:09:53, Till Oliver Knoll wrote:
> ActiveQt is one of the exceptions which supports platform-specific
> technology (D-Bus support on Unix (Mac?) being another example).

That last part is wrong actually, qdbus works under Windows after
installing the dbus-windows port. How else should KDE4 work on Windows
;)

Andreas

-- 
 [ signature omitted ] 

Message 8 in thread

I made some progresses about how to automate PowerPoint by Qt.
1) use dumpcpp.exe to generate a wrapper class (.h, and .cpp), and add 
them into your project.
    dumpcpp {91493441-5a91-11cf-8700-00aa0060263b}
2) To start PPT,
    PowerPoint::Application *oPPTApp = new PowerPoint::Application();
    oPPTApp->dynamicCall("SetCaption(QString)", "AutomatePPT");
    oPPTApp->dynamicCall("SetVisible(Office::MsoTriState)", true);
3*) To add an ActiveQt control into your presentation,
    shape = shapes->AddOLEObject(className);
4) Do slide show by
    presentation->SlideShowSettings()->Run();
5) To close PPT
    oPPTApp->Quit();

Question remains: how to initialize/customize the control after Step 3*)?
How to obtain an handler  from  IDispatch *idispatch = 
shape->OLEFormat()->Object();
???
Any help are appreciated.
Lingfa


--
 [ signature omitted ]