Menulis ke file word dengan menggunakan makro File pada Ax

Ini contoh codingnya :

static void writeWord(Args _args)
{
    #File
    AsciiIO     fileOut;
    container _fileFilter = ["Document Files","*.doc"];
    str fileName;
    CustTable custTable;
    int i;
    ;
    fileName = WinAPI::getSaveFileName(0,_fileFilter," ","Specify Save File Name", "", "");
    fileOut = new AsciiIO(fileName,#io_write);

    fileOut.write("No \tCust Account \tStatus Customer \tBlocked");
    while select custTable
    {
        if(i < 20)
        {
            i++;
            fileOut.write(strfmt('%1 \t%2 \t%3 \t%4',i,custTable.AccountNum,custTable.DI_StatusCustomer,custTable.Blocked));
        }
    }
    WinAPI::shellExecute(fileName);
}

Lagi cape tulis jadi dipahami sendiri aja ya … 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: