If I have an Outlook.MailItem how can I get the Location, Width and Height of this?
Also I need to "disable" the entire Outlook.MailItem form - how do I do this?
I want to show a centered "modal" dialog (just a Windows.Forms.Form) over this MailItem without it actually being modal.
Thanks
Update (more explaining)...
When a user clicks "Send" on a mail, I want to check it for large files before sending and if the file size are too big, then I want to show a "Files are too big, do you want to zip them" dialog. The dialog must be centered to the mail form and disable the mail form (like a dialog would) without freezing outlook.
There is no need to disable the default form in Outlook.
For example, the Open event of the MailItem class which is fired when an instance of the parent object is being opened in an Inspector. The Cancel parameter passed to the event handler allows to abort the default action. If the event procedure sets this argument to True, the open operation is not completed and the inspector is not displayed.
When this event occurs, the Inspector object is initialized but not yet displayed. The Open event differs from the Read event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an inspector.
Also you may consider using Outlook form region. The Replacement-all layout allows to override the whole inspector window. See Creating Outlook Form Regions for more information.
Why do you need to do anything with the form? Process the Application.ItemSend event, display the prompt if necessary, and cancel the submission process if you need to.
Related
While installation is executed (server-side) I looked for a way to pass the result back to the client side. Especially the FatalError dialog should show a text depending on the reason of the failure. Since it seams not possible to pass the result via properties I stored it in a file.
Furthermore I replaced the FatalError dialog with my own dialog to display an error text depending on the error type.
My problem is, that I need to call a custom action before the dialog is displayed, that reads the result from the file.
Possible ways could be:
1) I register the custom action for the OnExit="error" event.
Question: I need to display the dialog afterwards. Maybe the custom action (C++) can show the dialog after it loaded the result from the file. But how?
2) My own FatalError dialog is registered for the OnExit="error" event (as usual).
Question: How can I call the custom action before the dialog is shown?
3) My own FatalError dialog is registered for the OnExit="error" event (as usual). It shows only a common error text. When the user clicks Next the custom action is executed and another specific error dialog is displayd.
Problem: That bothers the user with pointless dialogues.
4) Any other idea ...?
Thanxs in advance.
By means of 1) I could finally solve the problem. A custom action can display a dialog using MsiDoAction. Example:
MsiDoActionW(
hInstall, //MSIHANDLE hInstall,
L"MyFatalErrorDlg" //LPCWSTR szAction
);
I'm about to develop an add-in that will automatically pull some data from emails and modify some fields in our database. However this extraction could be a bit error prone so we wanted a layer of human verification when it occurred.
We do this in gmail already, when the user open an email and we find something we want to extract we display a confirmation pop-up, and this feature is very well received by our clients.
I am planning on using the dialogbox but it seems to trigger this the action to display the box needs to be attached to a ui element for the user to click.
Is there any way to tigger an action pragmatically, without a users click?
Take a look at the pinnable task pane available for Outlook add-ins, see Implement a pinnable task pane in Outlook for more information. There you can implement the ItemChanged event handler. The event handler should accept a single parameter, which is an object literal. The type property of this object will be set to Office.EventType.ItemChanged. When the event is called, the Office.context.mailbox.item object is already updated to reflect the currently selected item.
Office.initialize = function (reason) {
$(document).ready(function () {
// Set up ItemChanged event
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, itemChanged);
UpdateTaskPaneUI(Office.context.mailbox.item);
});
};
// Example implementation
function UpdateTaskPaneUI(item)
{
// Assuming that item is always a read item (instead of a compose item).
if (item != null) console.log(item.subject);
}
I have called a leave event for a a text box and in it called another buttons event named Retrieve button. so now I just want to check in this retrieve button event weather the text box's leave event is called or not?
When you call the retrieve button event from the text box leave (blur) event you could simply add a flag into the eventArgs that you can check in the retrieve button. This flag would only be set when you implicitly call the retrieve button even from the text box leave event.
This would mean that if the retrieve event is called from other places the flag would not be set so you could tell that the call definitely came from the button leave event.
how i can get (if)any text is selected in textbox and i want to get it in any variable of javascript.... specifically for Mozilla firefox...?
the above description is not enough so let me give completely the definition.. My Extension of firefox is an Extension that double clicks any word from the webpage and finds its possible meaning from database... so user can even write anything in Textbox and double click the same for finding its meaning.. so please do suggest any way to complete selection from textbox's selected text....? in addition i am already using dblclick event handler so dont suggest that solution.... Also the problem is that the web page can be any site's webpage so even the textarea or any control is specific tho that page how could i slice the text from it than ...Thanxx in advance....
You can use document.getSelection() which returns a selection object containing the currently highlighted text in the document. However, calling it at the right time can be tricky. You can't do it from an onclick handler on a button, for instance, because by the time the onclick handler fires, the selection's focus has been removed from the text and moved to the button.
Use the selectionStart and selectionEnd properties e.g.
var selectedText = textbox.value.slice(textbox.selectionStart, textbox.selectionEnd);
In my program, I want to change the inputType of Ext.form.TextField when clicking another control. You an imagine about the password textfield and a "Show/Hide" button. I register event for the "Show/Hide" button to change the display form of password. But because that textfield has already rendered before this button click event was fired, so the inputType of it dis not affect immediately. Can you help me? Thank in advance.
The config options are not properties in the sense of C# for example, changing them does nothing because there's no way for the object to know you've changed them, which is usually why you have the many set* methods.
However there is no method for this for TextField so you'll probably have to re-create the object with the required configuration.