Home > Back-end >  Open an existing WORD documents, C builder, 2010
Open an existing WORD documents, C builder, 2010

Time:10-23

Ace to give directions, thank you very much!
I want to use a button to open an existing WORD documents, c + + builder, 2010,
how to operate?Office 2 k is not working!

CodePudding user response:

This question required rabbit rabbit, broken,
 String strDocName="D: \ \ ccrun \ \ 123. Doc"; 
The Variant vWordApp vDoc, vPara vRange;
Try
{
VWordApp=the Variant: : CreateObject (" Word. Application ");
}
The catch (... )
{
MessageBox (Handle, start the Word wrong! "" ,
Application - & gt; The Title. The c_str (), MB_OK | MB_ICONERROR);
VWordApp=Unassigned;
return;
}

VDoc.=vWordApp OlePropertyGet (" Documents ").
OleFunction (" Open ", WideString (strDocName));
.