VarDoc=VarApp.OlePropertyGet("Documents");
VarDoc.OleProcedure("Open", WideString(str));
VarApp.OlePropertySet("Visible",true);
}
catch(Exception &ex)
{
str_errors=ex.Message;
ShowMessage(str_errors);
} }
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
WideString macr;
macr="BIR";
WordApplication1->Run(macr.c_bstr());
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
WideString macr;
macr="IKKI";
WordApplication1->Run(macr.c_bstr());
}
//-------------------------------------------------------------
Dastur yaratilishi jarayonida qo’shimcha sifatida Word dasturida Normal.dotm
shablonidan ham foydalanildi, quiyda foydalanilgan makroslar kodini keltiramiz.
Sub BIR()
Dim x As Integer, y As Integer
Dim a As Integer