Outlook Addin doesn't render HTML forms using VSTO but using C++ API does - vsto

I am rewriting C++ Outlook Addin application to it full .NET representation using VSTO (Outlook 2007/2010).
One of the features to rewrite is html forms rendering. User can select checkbox, provide input, select option etc. in compose mail mode (before sending). But when I put any input markup to HTMLBody property it isn't rendered as expected. Instead only something like http://postimage.org/image/jk9swfr2t/ is rendered. I spent a very long time to search for a solution but it always ultimately turned out to be impossible due to Word based Outlook HTML render engine.
Our C++ addin code repository is extremely large and is legacy - I am not a c++ developer and don't know to much about COM and c++ outlook corresponding APIs, the target is to rewrite according to existing functionalities, there is simply no time and no resources to analize legacy code.
But the most interesting to me is that c++ version of software render everything: inputs, checkbox, select option, just everything! So I guessed it is possible and started looking for a workaround or any kind of hack.
I analyzed the old c++ addin using OutlookSpy tool and it turned out that it doesn't fill HTMLBody. I had to wade through a partial legacy code and found that it set PR_HTML MAPI property. Unfortunately I found also that this property is not available in vsto so I can't check if it helps.
So my questions are:
do you know any hacks to render HTML forms in Outlook using VSTO?
are there any differences using item.HTMLBody or PR_HTML MAPI property which can have impact on my problem?
if yes then can I set PR_HTML using C#? (I've checked free http://www.add-in-express.com/creating-addins-blog/2008/11/21/outlook-object-model-propertyaccessor-storageitem/ but it doesn't work for me - code doesn't execute when I add AddExpress.MAPI.dll)
Everything must be done programmatically so inserting using Outlook UI or exporting to Outlook from IE doesn't count. Also we can't use commercial third party tools like Redemption or Add-in Express.

Are you sure you posted the right picture? :-)
Keep in mind that Outlook uses Word to render HTML, so any input controls and scripts will not run.

Related

Insert a PowerPoint content add-in using COM/PIA

We have a desktop app communicating with the running PowerPoint app through COM (using NetOffice wrapper) which is able to create, modify slides and shapes in the opened document by calling COM methods. We also have a modern JS-based content add-in, which we would like to configure and insert to a specific slide from that desktop app (like a standard shape). I went through the entire object model documentation, but didn't find anything regarding the content add-ins.
So, my question is: It is somehow possible to insert a modern/JS PowerPoint content add-in (or even install it if missing to PowerPoint) using the COM/PIA API?
No, the PowerPoint extensibility model doesn't provide anything for that.

VSTO Addin - Own button type like "ShapeWidth" and "ShapeHeight"

I am currently working on an PowerPoint Addin and I am currently finishing the Ribbon. I'd like to create a control to change the size of objects that looks similar to the inbuild button "ShapeWidth" and "ShapeHeight":
However, I couldn't find the correct control type and hence I built the below by myself using an editbox and buttons. Although it's working I find the other style way cleaner but I haven't found the correct type.
Not all Ribbon X (Office Fluent UI) control types that Microsoft uses in its Office applications are made available to third-party developers. This, I'm afraid, falls into that category.
You should probably be able to get the image, at least, by specifying the idMso for the built-in control.

Create a vba message box that uses html

How can I return a message box with functioning HTML tags using VBA?
example
dim mtext as string
mtext = "<em>hello</em> <br> world"
msgbox mtext
You don't. The MsgBox function is just a thin wrapper over a Win32 API function, and that function doesn't deal with HTML input. HTML is for web browsers, not desktop applications.
The closest thing you could get is a custom UserForm with a RichTextBox control, but that's OCX tech developped for Visual Basic 6.0 and probably won't work on x64 machines, not to mention that it will definitely break down if you need to distribute your macro to users that don't have the OCX on their machines.
A better alternative could be to make a COM-visible class library in your favorite .NET language (C#, VB.NET), and expose a custom MessageBox function that displays a WinForms dialog featuring a System.Windows.Forms.RichTextBox control that can process and display RTF formatted text.
You then need to distribute and register your COM type library to your users.
In other words, it can be done - it only depends how badly you want it.
I would custom design a form and then have the text set based on your needs specifically. May I ask why you are wanting to use HTML codes? Cause, it may be simple enough to create your own library/class to handle the processing, before pushing to a rich text box. However, the Rich Text Box is only going to be in VB, like using VB Studio Express. With VBA, you're sort of stuck...sorry.

Location of Infopath Custom Code on SharePoint

I have an Infopath 2010 form that's been developed for a document library in SharePoint 2010. The form contains custom VB code, which is saved on a shared drive.
However, should the VB project on the shared drive get deleted/damaged/forgotten about, is there a way to retrieve the custom code from SharePoint itself? I know you can go to Library Settings>Advanced Settings>Document Template>Edit Template to retrieve the Infopath form, but when you attempt to edit the custom code, Infopath asks for the VB project location.
Does a plain-text, uncompiled version of the code get stored somewhere in SharePoint when the form is deployed?
When I have needed to get the code for a form and don't have access to original code files, one approach I have taken is to save the form as source files (either unzipping the template with a tool like 7-zip or from the publish menu in InfoPath in design mode) and then decompiled the code DLL with ILSPY. Imperfect & a bit of a pain, but has allowed me to see what may be going on in a template file and recreate the source code when needed.
Found my own answer - looks like I'd be out of luck.
http://www.bizsupportonline.net/blog/2013/recover-make-changes-infopath-forms-sharepoint.htm
Paragraph at the bottom just before "3 ways you can find out whether code was written for a form template"
That's a pretty helpful feature, Infopath...

How to get selected text from a webpage?

I need to retrieve only selected portion of a webpage (user open a webpage in web-browser control, then he/she would select some portion of a webpage, i just need only those selected portion/text) in vb.net in visual basic language. How to do ?
i am using microsoft visual studio 2008
Language: Visual Basic
FrameWork: vb.net 3.5
Perhaps here are some answers for you(first post attachment):
Manipulate/Change/Form Fill data in webpages using the Webbrowser control
In terms of IE's API, you can get the select text by getting the selection object via IHTMLDocument2::Selection the property, then create a range object via IHTMLSelectionObject::createRange. If the return range's type property is "Text", you can then query IHTMLTxtRange from it and get the selected text via IHTMLTxtRange::text.
It is unclear which webbrowser control you are referring to. There are 3 webbrowser controls in the .Net Framework, one in Windows Forms, one in WPF, and one in Silverlight. Anyway, you can call InvokeScript or use the unmanaged interface like csexwb's GetSelectedText, if one of the method is supported by your control library.
Next time mention which control library you are using when you ask the question. Merely mentioning the language you choose isn't enough to resolve the ambiguity in class names.