I am developing a vsto add-in for Outlook.
I am trying to set the HTMLBody of the mail. However, if the mail I open is present in Drafts folder, I can set the HTMLBody of the mail and the preview shown is fine. But if the mail is present in the Deleted Items folder, the HTMLBody property of the mail is set but the preview just doesn't show the updated content. Is there any way to refresh the preview? Or am I missing something?
Update 1:
I have a separate form region, for the mail item.
I have a draft on which I am working. Lets say, it's initial HTML content is A. Lets say, I am setting the HTMLBody property of the mail to B, after navigating to the form region. But I am not yet saving the mail. So when I navigate back to the mailbody, I can see the changes (mail body displays B) for the time being. Of course the changes will be lost if i don't save.
But, now I delete the draft, so that it moves to Deleted Items folder. The HTML content is still A as it was not saved.. Now when I open this draft (from deleted items folder), and navigate to form, I set the HTMLBody property to B. But it doesn't show that change when I navigate back to the mail body. The mail body still shows A.(The inspector is still open, it's not closed) But when I check in my debugger, the HTMLBody property is set to B. Why?
You need to save the message (MailItem.Save), otherwise the changes are mot persisted. If the messages is moved to the Deleted Items folder, it is a physically different message, and it will not carry over any unsaved changes.
Related
Having a problem with mail layout when adding an attachment
The layout goes to the right and keep empty space in the left side
It happens just when i add an attachment and have this problem in gmail application
show image
I am developing an Outlook web addins that involves extracting all hyperlinks from the mail message. I am currently doing it by getting all a tag elements.
var htmlParser = new DOMParser().parseFromString(asyncResult.value, "text/html");
var urls = htmlParser.getElementsByTagName("a");
However, I found out that Outlook for PC displays text as a hyperlink as long as it contains www., even though the text is not meant to be a hyperlink. For example, I tried sending myself an email with www.example.com as the content and I ensured that it is not a hyperlink when I sent it out.
In Outlook on the web, the text is indeed not a hyperlink.
But then in Outlook for PC, the text was displayed as a hyperlink automatically. Since I did not send it out as a hyperlink, it does not have an a tag and hence my addin could not extract this "hyperlink". Is there a way to also extract these "hyperlinks" in a mail message?
You could use the getEntitiesByType API to get any URL entities identified in the mail body. A sample API call is:
Office.context.mailbox.item.getEntitiesByType(Office.MailboxEnums.EntityType.Url)
You can use this Outlook add-in - Mail add-in for a read scenario which finds and parses all links in the body of an email. Here's the documentation/sample # https://github.com/OfficeDev/Outlook-Add-in-LinkRevealer
For the contact entity I have set the default values for some build in fields to specific values. For example I set the default value for the field "Contact -> donotemail" to the value "Do not Allow".
In the "normal" web browser forms it seems to be working as expected.
But if I create a new contact using a quick create form and select the save and then "view created record" button the view switches to the new created contact.
If I then scroll down to the "donotemail" - field the field does not have the default value I selected in the field settings.
I googled the problem, the nearest community post I could find is
https://community.dynamics.com/crm/b/mohamedmostafacrmblog/archive/2016/06/02/set-field-default-value-in-microsoft-dynamics-crm-online-and-on-premise-using-business-rules-without-javascript-or-custom-components-plugins-or-workflows
Unfortunately the post is from 2016 and it describes how to workaround the problem using custom business rules. But due to this is build in funtionality there is no business rule I could edit and creating some new to achive the goal of setting a default value seems odd.
Did someone encounter this problem too and could find a solution?
One possible reason I could think of: you might have not refreshed the main window after publish all, maybe cached QC form didn’t work as expected bcoz “customize the system” will open a separate popup to edit & publish all.
Still technically server side should not be cached with old customizations. But QC might have rendered from cached Metadata in browser.
But publish all should reflect immediately & no delays expected. Make sure to refresh the main window next time :)
I have a CSV File on my File-System with a list of events, and I need to read the events from this File and just show them up in the Outlook calendar along with other appointments, meetings etc, that are actually in outlook.
So I don't won't to Save to the Server or Send any of these events read from file, just use the calender to show them.
Is that possible?
Thanks
No, Outlook w3ill only show the appointments that exist in the given folder.
As Dmitry noticed, the Outlook object model doesn't provide anything for that (i.e. display items that don't exists in the folder).
But you may consider displaying your own form inside Outlook instead of the built-in one for displaying events and appointments from the CSV file and Outlook calendar.
There are sevaral ways to get the job done:
Use adjucent Outlook windows. See Adjacent Windows In Outlook for more information.
Display a home page for the folder. The WebViewURL property of the Folder class allows to set a string indicating the URL of the Web page that is assigned to a folder.
ADX provides the WebViewPane layout which is actually based on the web view technology. But in that case you will be able to use any.Net controls on the form.
I am working on a website. Here I want to import gmail contacts. To achieve this, in the parent page(php), I have added a link as mentioned below.
<a style="font-size:25px;font-weight:bold;" href="https://accounts.google.com/o/oauth2/auth?client_id=213413545397468.apps.googleusercontent.com&redirect_uri=https://localhost/oauth/oauth.php&scope=https://www.google.com/m8/feeds/&response_type=code" onclick="window.open(this.href,'targetWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=880,height=550'); return false;">Click here to Import Gmail Contacts</a>
Below this link there is a textarea, where I want to populate all gmail addresses.
When I click on this link, a new popup window is opened which allows me to log in to gmail. Once I log in, it displays all the gmail addresses in the address book in the popup window itself.
As mentioned earlier, I want to populate the textarea with the gmail address. So, for that I have added a javascript in the child php to populate the parent page.
window.opener.document.getElementById('textarea').value ='email addresses';
But nothing gets populated in the textarea.