<< Click to Display Table of Contents >> BeforeMail Event - Java |
[GUI version only]
Is fired, when the user clicked the eMail-button in the preview (or pushed the corresponding key). The e-mail was not sent yet, therefore your application has now the option to set receivers, attachments, etc. by code.
public void BeforeMail(
CancelEvent e
)
CancelEvent e
The cancel event is defined as:
public class CancelEvent extends java.util.EventObject {
private boolean cancel = false;
public boolean getCancel() {
return cancel;
}
public void setCancel(boolean cancel) {
this.cancel = cancel;
}
public CancelEvent(VpeControl source) {
super(source);
}
}
You can call e.setCancel(true) if you want to cancel the event, i.e. deny that the document will be mailed. Cancelling the operation allows you to display your own mail dialog and/or to execute your own mailing code.
Example:
public void BeforeMail(CancelEvent e) {
e.setCancel(true);
// Here comes your own code to mail a document
}