How to open text file with the help of button under any form in Ax 2012

I have one text file(Notepad) put under resources node in AX 2012 AOT. Now, my task is to open this file with the help of button under any form.

http://msdn.microsoft.com/en-us/library/cc967403.aspx

Above link is helpful when creating temporary file for writing or reading. Also, there is a form in AX 2012 named “smmdocuments” in which we can put text files of our use and we can open that file easily from there. I have researched and found that there is a class named “DocuAction” in AX 2012 to perform operations with text files. But i am unable to understand how that thing is working. Any help will be appreciated!!!

I got it working as:

void clicked()

{

//super();

str sTempPath,

sFileName = “notes.txt”;

SysResource::saveToTempFile(SysResource::getResourceNode(resourceStr(mytextfile)), false, “notes.txt”);

sTempPath = WinAPI::getTempPath();

WinAPI::shellExecute(sTempPath+sFileName);

}