View Single Post
  #3  
Old May 25th, 2004, 08:39 AM
Alessio
external usenet poster
 
Posts: n/a
Default AVOIDING "Select Data Source" dialog box?!?

Hi Cindy,
the point is that I'm not trying to open the data source. The method
I'm using, causing that dialog box to appear, is the Open method of a
Documents object (it's a VC++.NET application). Here's the code of the
Open method:
....
oDoc = m_oDocs.Open( COleVariant( szPath ), // name
vtFalse, // ConfirmConversions
vtFalse, // ReadOnly
vtFalse, // AddToRecentFiles
vtOpt, // PasswordDocument
vtOpt, // PasswordTemplate
vtTrue, // Revert
vtOpt, // WritePasswordDocument
vtOpt, // WritePasswordTemplate
COLeVariant( 1L ),// Format = OpenFormatDocument
vtOpt, // Encoding
vtTrue, // Visible
vtFalse, // OpenAndRepair
vtOpt, // DocumentDirection
vtTrue, // NoEncodingDialog
vtOpt ); // XMLTransform

I suspect that it's that particular Word document causing this
(strange, I think) behaviour. But I'd like to be able to manage it...
I mean, I have to!

Thank you
Alessio


Cindy M -WordMVP- wrote in message news:VA.000098d0.01ae7c77@speedy...
Hi Alessio,

Please post the OpenDataSource method's code you're trying to use.

Note that there was a very important change in this method's syntax
starting with Word 2002. So you probably will need to either have two
procedures (one for 2000/97, another 2002 and later) or you will have to
use late binding for the Word object model.

It happens with a certain Word2003 mailmerge document: I open it using
Word2003 (through OLE), and a "Select Data Source" dialog box appears,
asking me to specify the data source path. If I manually cancel that
dialog box, then everything seems to work as usual (i.e., as Word2000
usually behaves), and the automation code works.
But, HOW CAN I AVOID THAT DIALOG BOX ?!?!? IT MAKES THE AUTOMATION
CODE HANG!!!


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :-)