void __fastcall TForm1::Button1Click(TObject *Sender)
{
fstream file;
char* path="C:\\Users\\user\\winInstal.txt";
Variant wordExe, wordValues;
file.open(path, ios::in );
if( file.good() )
{
string text;
wordExe=Variant::GetActiveObject("Word.Application");
wordValues=wordExe.OlePropertyGet("Selection");
while( !file.eof() )
{
getline( file,text );
wordValues.OlePropertySet("Text",text.c_str());
wordValues.OleProcedure("Select");
wordValues=Unassigned;
wordExe=Unassigned;
}
file.close();
}
else
ShowMessage("You can't open file");
}
Brak komentarzy:
Prześlij komentarz