Word 2007 Document.Compare fails when using DSOFramer 1.3

I

Indian Ocean

Hi,
I am working on a application developed on top of DSOFramer 1.3.
I want to compare the currently loaded document within DSOFramer with
another one located in file system.

This functionality works fine but fails (no proper exception info I could
get) with Word 2007 (whether it's DOC or DOCX format).

The following code I am using:
MSWORD2007::_DocumentPtr doc2007 = doc;
_variant_t vtTarget((long)MSWORD2007::wdCompareTargetCurrent, VT_I4);
_variant_t vtTrue(true);
hr = doc2007->Compare(sFileToCompare, &vtMissing, &vtTarget,
&vtMissing, &vtTrue, &vtMissing, &vtMissing, &vtMissing);

I have also tried raw_Compare method but no success.

The similar code for Office 2003 is there which works fine when I have a
Word 2003 on client machine.
Code for Office 2003:

MSWORD2003::_DocumentPtr doc2003 = doc;
_variant_t vtTarget((long)MSWORD2003::wdCompareTargetCurrent, VT_I4);
_variant_t vtTrue(true);
hr = doc2003->Compare(sFileToCompare, &vtMissing, &vtTarget,
&vtMissing, &vtTrue);

Please help me understand whether document level compare is working or not
in Word 2007 in embedded mode? What i need to change to make it working in
above 2007 related code?

Thanks in Advance,
 
A

Actual Food

I had a similar problem to this. I think it is due to a limitation in
DSOFramer control which can only handle a single document at any one time. In
Word 2007 the 'Compare' button is disabled on the toolbar when viewed inside
the DSOFramer (as is the 'Office button'). I guess these features just aren't
supported when Word is hosted in this way. I had to resort to using a
separate non-embedded instance of Word to compare the documents and then open
the comparison document in the DSOFramer.
 
I

Indian Ocean

Hi,
Thanks a lot for your answer.

I have a small doubt here,
When I am having Word 2003 client this works perfect while for the same
document, when I have Word 2007 client, then only it fails. The application
is same based on DSOFramer 1.3
So I think it should not be limitation of DSOFramer 1.3.
Any thoughts on this?
 
C

Cindy M.

Hi Indian,
When I am having Word 2003 client this works perfect while for the same
document, when I have Word 2007 client, then only it fails. The application
is same based on DSOFramer 1.3
So I think it should not be limitation of DSOFramer 1.3.
Any thoughts on this?

Word 2007 performs the Compare differently than word 2003. That's probably the
reason.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
I

Indian Ocean

Hi,

Thanks for the answer,

So, how Word 2007 behaves differently than Word 2003, any pointers?
As I mentioned ealier, if I want to get it done programatically then what
should be the best alternative?
I tried that if we create application instance ("Word.Application"), Open
two documents and use the same code, it works fine but I can not take that
approach as our document is already loaded in DSOFramer and then I want to
perform "Compare" of loaded document with another one in file system. I have
mentioned the code before for the same. So using the same way, is there any
workaround there?

Thanks in Advance,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top