try
{
statusLine = "Querying Office for current document";
status.setStatus( 1, statusLine );
XScriptContext scriptcontext = xsc;
XModel xmodel = scriptcontext.getDocument();
storedDoc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xmodel);
// find document name from storedDoc
attachmentName = storedDoc.getLocation();
}
catch( Exception e )