Office Word Programming >> DSOFramer & Word 2007

by Michael Cessna » Thu, 23 Nov 2006 00:49:36 GMT

It appears that the DSOFramer.ocx project
(http://www.microsoft.com/downloads/details.aspx?familyid=CE2CA4FD-2169-4FAC-82AF-770AA9B60D77&displaylang=en)
will no longer save Word documents when using Word 2007 (released version).
However, it works ok with the Beta and TR of Word 2007. The method that is
failing is CDsoDocObject::SaveStorageToFile. I've verified that the document
is in 97-2003 format and that the "Save files in this format" option is also
set to 97-2003.

Any ideas?

Thanks.

Regards,

Michael Cessna




Office Word Programming >> DSOFramer & Word 2007

by Michael Cessna » Thu, 23 Nov 2006 06:07:03 GMT


An update regarding the problem:

The problem appears to be related to the call to IPersistFile::Save in
CDsoDocObject::SaveStorageToFile. This method returns success...but the Word
document is not created, which means that either the implementation in Word
2007 is wrong or that the example is wrong with regard to Word 2007 (I tried
other parameters and techniques using IPersistFile without success). The
quick solution is to comment out the IPersistFile code and just use the
StgCreateDocfile method of creating a Word document in the
CDsoDocObject::SaveStorageToFile method.

Thanks.

Regards,

Michael Cessna








Similar Threads

1. Save in old Word format (2003) when using DSOFramer with Word 2007 - Office Word Programming

2. Word 2007 Document.Compare fails when using DSOFramer 1.3

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,
-- 
Mahesh Devjibhai Dhola

3. DsoFramer, Word 2003 and the 2007 file format - Office Word Programming

4. Subject: Word 2007 Document.Compare fails when using DSOFramer 1.3

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,

-- 
Mahesh Devjibhai Dhola

5. DSOFramer 1.3 - FrameHookPolicy doesn't work in IE8 for Word 2003

6. Starting Word with no startup templates in DSOFramer

7. PrintPreview with MS Word XP (2002) and DSOFramer problem

8. Adding Toolbar or Menu to Word embedded in WinForms via DSOFramer