You also can use TextIo object :

void main(Args _args)
{
    str            filename, txt;
    TextIo       file;
    container   c;
    ;

    filename = "C:\Axapta\Test.txt";
    if (! WinAPI::fileExistsClient(fileName))
        return checkFailed(strfmt("@SYS62207",fileName));

    if (filename)

    {

        file = new TextIo(filename, mode);

    }

    else

        file = null;


    file.inFieldDelimiter(file.inRecordDelimiter());
    while (file.status() == IO_Status::Ok)
    {
        c = file.read();

        if (file.status() != IO_Status::Ok)
            break;

        [txt] = c;
        txt = strLRTrim(txt);
        ....................................................... *you can put 
any kind of your logic here*
    }
}

Regards,



Iin Dewi Wahyuni
http://geeks.netindonesia.net/blogs/idw/ or

http://www.linkedin.com/in/iindewi

--- On Tue, 8/17/10, Sumit Loya <[email protected]> wrote:

From: Sumit Loya <[email protected]>
Subject: Re: [Axapta-Knowledge-Village] Open a file
To: [email protected]
Date: Tuesday, August 17, 2010, 8:33 AM







 



  


    
      
      
      Hi Afin,
 
Try this out
 
static void openFile(Args _args)
{
    #WinApi
    str filename = @'C:\Users\sumit.loya\Desktop\Test.docx';
    ;
    
    WinAPI::shellExecute(filename,'','',#ShellExeOpen);

}
 
Regards,
Sumit


On Tue, Aug 17, 2010 at 5:55 PM, thomas 'znal' ramdhan 
<[email protected]> wrote:


  



Hi Nix,

Thanks for replying, but what I mean was not the content. I'd like to launch 
the file from axapta.
I've tried code "infoLog.urlLookup ", but the result was return an error.

Thanks and Regards,

Afin


On Tue, Aug 17, 2010 at 2:31 PM, Nix <[email protected]> wrote:


  




Hi Afin,
 
You can use SYSEXCELAPPLICATION class for opening the excel application on the 
desktop from AXAPTA.
 
The Code should look something like this
 
    SysExcelApplication application;
    SysExcelWorkbooks workbooks;
    ;
    application = SysExcelApplication::construct();
    workbooks = application.workbooks();
    application.visible(true);

    workbooks.add(); // In case you want to open a new blank worksheet
    workbooks.open( str _filename)// In case you want to open the existing file 
in to excel from the code in Axapta.(Str _ filename is nothing but the string 
parameter for the function) i.e. your existing file path.






On Tue, Aug 17, 2010 at 12:35 PM, thomas 'znal' ramdhan 
<[email protected]> wrote:


  



Dear all,

I'd like to know, how can I open a file automatically through Axapta ?
Let's say, I have an excel file in my desktop, and I'd like to open it by code 
in Axapta.

Thanks and Regards,

Afin

-- 
ne faites pas une limite pour votre competence
-------------------------------------------------------------------------
bilden Sie nicht eine Begrenzung fur Ihre Fahigkeit
-------------------------------------------------------------------------

non faccia un limite per la vostra abilita
-------------------------------------------------------------------------
--(-@




-- 

Thanks and Regards
Nikhil   Pujar




-- 
ne faites pas une limite pour votre competence
-------------------------------------------------------------------------

bilden Sie nicht eine Begrenzung fur Ihre Fahigkeit
-------------------------------------------------------------------------
non faccia un limite per la vostra abilita
-------------------------------------------------------------------------

--(-@






    
     

    
    


 



  






      

Reply via email to