473,671 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Office Automation using MFC

Hello All,

My aim is to have a MFC application which takes two word file names as
input. Then it opens these two word files in ms word apllication
windows for comparing side by side with eachother. This is also known
as Office Automation. I am trying to use the dynamic approach.
The Dynamic approach:
1) Get class id of the required class.
2) Using "CoCreateInstan ce" create an instance of this class. This
also returns a pointer to the Unknown Interface.
3) Using the "QuerryInterfac e" and pointer to Unknown Interface get
a pointer to the Dispatch Interface.
4) If any further interface is needed use "QuerryInterfac e" and the
pointer to Dispatch Interface get a pointer to the Required Interface.
5) Use the final Interface Pointer and "GetIDsOfNames" , to get
DispatchId of the required function.
6) Use the DispatchId and final Interface Pointer to "Invoke" this
function.

The method I need to use is "CompareSideByS ideWith". This method
can be accessed only by an object of "Windows" class or
"Word.Docum ent" class. The class id of the class "Windows" is
not available hence I have to use the class "Word.Document" . Using
the class "Word.Document" , I am able to get till step 4, i.e. I am
able to get a pointer to it's Dispatch Interface. In step 5 it does
not return any Dispatch id for "CompareSideByS ideWith" method. In
the msdn documentation it is mentioned that "CompareSideByS ideWith"
is a method of that class. No documentation can be found to check if
there are any intermediate interface between the "Dispatch" and the
required method.

Can anyone please tell me where I am going wrong?

Thanks,
Viraj
Mobiliti Inc.
a.*****@mobilit i.com
http://www.mobiliti.com

Nov 13 '05 #1
1 1881
On 2 Jun 2005 06:48:33 -0700, vi************@ gmail.com wrote:
Hello All,

My aim is to have a MFC application which takes two word file names as
input.

<snip>

Hi
Try another group. possibly microsoft.publi c.vc.mfcole, or
microsoft.publi c.word.oleinter op

David

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6252
by: Richard | last post by:
Office Addins are easy in .NET. Try this from Visual Studio's main menu: File New Project "Other Projects" Extensibility Projects Shared Addin Run the wizard and you're off...
2
1829
by: Alex Maghen | last post by:
Hi. I've seen several KBs on using .NET for MS Office Automation. But I have a particular question: I am developing a somewhat stand-alone .ASPX page which will need to do some relatively simple MS Office Automation (Office 2003+). The .ASPX page is not part of a Web Forms Visual Studio project. It's just a stand-alone file. And therefore, there is not "References" setting or anything because there's no Visual Studio project. My...
0
1349
by: Karel | last post by:
Hi, I have developed a vb.net application to create a mail-merged document by using Automation to word from VB.NET. I added the following reference to the application: Microsoft Office 10.0 Object Library In runtime, when I click that button, I open a word doc. I create a commandbar whith in that commandbar a combobox with a list of fields
2
2440
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability, where I declare objects as follows: Dim oWordApp As New Microsoft.Office.Interop.Word.Application, after adding a reference to Microsoft.Office.Core and a reference to Microsoft Word. I could do this since I have the Primary Interop...
6
1866
by: Luke Vogel | last post by:
Hi all ... could someone point me in the right direction for programming office applications (specifically excel) using vb.net? Can vb.net replace or enhance VBA that comes with the office suite? cheers... have a great Christmas all! -- Regards Luke. ----- There are 10 types of people in this world
1
1330
by: Alberto | last post by:
Hi all. I'd like to know if the "architect" version of Visual Studio .NET includes the environment to develop Office application. Any way is it possible to devolpo Office XP apps with VS .Net or I need some more componentes ? Thanks
1
5501
by: BK | last post by:
I have a .NET Solution (currently in 2003, FW 1.1) that uses Office automation for a few things (generates a Word document, dumps datagrids to Excel, etc.). One of my programmers works on the project from time to time. We always have problems when he loads up the latest version of the Solution however, and it appears to be a compatibility issue with difference in Office versions. My development platform is Xp Professional running...
12
1633
by: Tomas | last post by:
Hi, I have worked with VB.NET for half a year (semi-newbie). Currently I am looking around for some books for those that crossed the starting hurdle. There are too many books out there-make choosing, a bit of a gamble. If you have experience of good VB.NET books on general and office automattion, you could recommend, it would be greatly appreciated.
1
3217
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
1
2864
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I want to achieve this using only one Interop dll if this is possible. Tried so far:
0
8392
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8912
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8669
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.