-------------------
# include
# include
# include
# pragma hdrstop
# include "Unit1.h"
// ---------------------------------------- -----------------------------------
# pragma package (smart_init)
# pragma resource "*. dfm" * Form1; * s = new TStringList; ech = 0; name; name2; nep = 0; prav = 0;
// ---------------------------------------- -----------------------------------
__fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{
}
{-> Items-> Clear (); -> Text = ""; MyExcel = CreateOleObject ("Excel.Application"); (ListBox1-> Count == 0)
{
ShowMessage ("???????????????????????????????? email"); p>
}
{(OpenDialog1-> Execute ()) name2 = OpenDialog1-> FileName; (name2 == "")
{
ShowMessage ("??????????????????????????? email!");
}
{. OlePropertyGet ("WorkBooks"). OleProcedure ("Open", name2.c_str ()); vCells = MyExcel.OlePropertyGet ("Cells"); vVarSheet = MyExcel.OlePropertyGet ( "Worksheets"). OlePropertyGet ("Item", 1); iFirstRow = = = i = 0; i
{= vCells.OlePropertyGet ("Item", iFirstRow, iFirstCol); -> Items-> Add (mail); + +;
} w = 1; str = vCells.OlePropertyGet ("Item", 2, w); str2 = vCells.OlePropertyGet ("Item",
{+ +; = vCells.OlePropertyGet ("Item", 2, w); = vCells.OlePropertyGet ("Item", 3, w);
} -; (str.Pos ("@") | | str2.Pos ("@"))
{-> ItemIndex = w;
}
{-> ItemIndex = -1; ("?????????????????????????? email??? ???? ");
} + +;. OleProcedure ("Quit");
}
}
}
{name; MyExcel = CreateOleObject ("Excel.Application");> Clear (); -> Clear (); (OpenDialog1-> Execute ()) name = OpenDialog1-> ; FileName; (name == "")
{
ShowMessage ("????????????????????????????? email!");
}
{. OlePropertyGet ("WorkBooks"). OleProcedure ("Open", name.c_str ());
//????????? ?????????? ???????:??? -?? ?????,???????? p align="justify"> int iFirstRow = = = = = MyExcel.OlePropertyGet ("Cells"); (int i = iFirstRow-1; i
{(int j = iFirstCol; j
{> Add (vCells.OlePropertyGet ("Item", i +1, j)),> ProcessMessages ();
}
} -> Items-> AddStrings (s); Strok = s-> Count; stroki = Strok; ("??? -?????????? ???? email: "+ String (stroki)); = 1;. OleProcedure (" Quit ");
}
}
{MyExcel = CreateOleObject ("Excel.Application"); (ListBox1-> Count == 0)
{
ShowMessage ("???????????????????????????????? email"); p>
}
else
{
if (name2 == "")
{
ShowMessage ("??????????????????????????? email!");
}
{(SaveDialog1-> Execute ()) name = SaveDialog1-> FileName + ". xls";
{
if (name == "")
{
ShowMessage ("?????????????????????????????????!");
}
{(! CopyFile (OpenDialog1-> FileName.c_str (), name.c_str (), true))
{("?????????????????????" + OpenDialog1-> FileName + ".");
}. OlePropertyGet ("WorkBooks"). OleProcedure ("Open", name.c_str ()); vCells = MyExcel.OlePropertyGet ("Cells"); vVarSheet = MyExcel.OlePropertyGet ( "Worksheets"). OlePropertyGet ("Item", 1); iFirstRow = = 0; -> Max = iRowsCount;
//??? -?? email?? ???????? <<
int yRowsCount = = 0; = iFirstRow; -> Position = 0; -> Max = iRowsCount; (ListBox1-> Count> 0)
{> ProcessMessages (); str = vCells.OlePropertyGet ("Item", q, w); (CheckBox1-> Checked)
{> ProcessMessages (); str = vCells.OlePropertyGet ...