Welcome to
Tweak Marketing official website!
Advanced Email Parser 2.4
Advanced Email Parser v.2.4 has been released. Update it now.
 
download
Technical Support
  Overview
  Select SLA plan
  Knowledge Base
  Check current versions of our products
  Documentation
  Learning courses
  Helpdesk
  Live support
  Private Download
  Personal area

Home / Support / Documentation

• AEP Online Help Index

Usage of ActiveX objects in Script Components

Script components allow to use ActiveX objects into the AEP greatly expanding data processing and storing capabilities. Below is the example of saving the processing data in a Microsoft Excel document using JScript.

Global Variables
SenderName
SenderEmail
JScript Code
var wbname = "C:\\Program Files\\Advanced Email Parser\\Examples\\ActiveX\\list.xls";
var wbkey = SenderEmail.value;
var wbdata = SenderName.value;

var xl = new ActiveXObject("Excel.Application");
var wb = xl.Workbooks.Open(wbname);
var ws = wb.Worksheets(1);
var item = ws.Columns(1).Find(wbkey);
if(item)
{
    item.Cells(1, 2) = wbdata;
}
else
{
    var cnt = ws.Rows.Count;
    var idx = 1;
    while(idx < cnt)
    {
          if(ws.Cells(idx, 1).Value == null) break;
          idx++;
    }
    ws.Cells(idx, 1) = wbkey;
    ws.Cells(idx, 2) = wbdata;
}
wb.Close(true);

See also:

Information for Programmers, Script Components


 
 
Solutions | Products | Support | Price & Ordering | Partners | Blog & Articles | Company

Copyright © TweakMarketing 2012. All rights reserved.