#include "Word_2K_SRVR.h"bool opendoc( const wchar_t* fname){ VARIANT v = {0}; TWordApplication *Word = NULL; try { Word = new TWordApplication( NULL); v.vt = VT_BSTR; v.bstrVal = SysAllocString( fname); Word->Connect(); Word->Documents->Add ( &v); Word->set_Visible( 0xFFFF); return true; } catch(...) { if ( Word) Word->set_Visible( 0xFFFF); if ( v.bstrVal) SysFreeString( v.bstrVal); } return false;}