vsto

Outlook VSTO - Add new line to WordEditor Document Hyperlink

梦想的初衷 提交于 2019-12-12 01:09:11
问题 I am using following code to add hyperlinks to my MailItem object link = url + System.Environment.NewLine; Microsoft.Office.Interop.Outlook.MailItem currentMessage = MyAddIn.Application.ActiveInspector().CurrentItem; Microsoft.Office.Interop.Word.Document doc = currentMessage.GetInspector.WordEditor; Microsoft.Office.Interop.Word.Selection sel = doc.Windows[1].Selection; doc.Hyperlinks.Add(sel.Range, ref result, ref missing, ref missing, ref link, ref missing); While this does insert each

Excel: Dump cell attributes to array

∥☆過路亽.° 提交于 2019-12-12 01:02:12
问题 I know I can quickly dump the values of excel cells into an array like so: object[,] values = workSheet.UsedRange.Value2 as object[,]; Can I do something similar for attributes of cells other than their values? For example, I'd like to get the cell colour, but object[,] cc = workSheet.UsedRange.Interior.Color as object[,]; results in cc being null. Looping through the sheet to get cell attributes takes orders of magnitude longer. 回答1: Better late than never. Briefly, in absence of a code stub

Outlook MailItem.HTMLBody encoding

谁说我不能喝 提交于 2019-12-11 23:01:21
问题 I'm trying to obtain mail body in HTML format. For some mails MailItem.HTMLBody returns string with ��� characters. Visual Studio Text Visualizer output: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <!-- default_css --><style></style><!-- default_css --> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content

Sub-windows created by an add-in

强颜欢笑 提交于 2019-12-11 20:37:10
问题 I have seen several times that an add-in can create sub-windows in Excel. Here is an exemple: Does anyone know which technique allows the add-in to create the sub-windows on the right hand side? 回答1: This technique is CustomTaskPanes 来源: https://stackoverflow.com/questions/35188359/sub-windows-created-by-an-add-in

How to handle VSTO prerequisites in SideWaffle project template

本小妞迷上赌 提交于 2019-12-11 20:10:33
问题 I'm building a VSTO project template with SideWaffle following the video from: How to create Visual Studio project templates with TemplateBuilder and SideWaffle I added an existing (new) stub VSTO project, set it not to build in both debug and release, but when I hit Ctrl+F5 to launch the Experimental VS instance I get the following three build errors: Could not copy the file "c:\users\john\documents\visual studio 2013\Projects\VisioVstoTemplate\VisioVstoTemplate\.NETFramework,Version=v4.5"

Trouble in Excel.Workbook.SaveAs

眉间皱痕 提交于 2019-12-11 19:01:07
问题 When I save an excel workbook : xlWorkbook.SaveAs("C:\\output\\excelfile.xls", Excel.XlFileFormat.xlCSV, misValue, misValue, false, false, Excel.XlSaveAsAccessMode.xlNoChange, misValue, misValue, misValue, misValue, misValue); it have no proplem. But String str = "C:\\output\\excelfile.xls";// or get file path from saveFileDialog xlWorkbook.SaveAs(str, Excel.XlFileFormat.xlCSV, misValue, misValue, false, false, Excel.XlSaveAsAccessMode.xlNoChange, misValue, misValue, misValue, misValue,

Office (esp. Outlook) addins [closed]

烂漫一生 提交于 2019-12-11 17:58:45
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . We want to develop addins for outlook, word and excel. As of now I am aware of 2 types of solutions. One to go for Shared Add-in (COM based) and other to build VSTO based Add-in. As I am new to this, which would be the better option? (Or if there is 3rd way,please let me know

Excel VSTO async button - strange behaviour with user interaction?

浪子不回头ぞ 提交于 2019-12-11 17:49:42
问题 I have an Excel Ribbon via VSTO. When a button is clicked, some processing happens and rows are populated on current sheet. During this process, Excel locks - the user cannot keep working with their program. My workaround involves implementing an async solution as follows: // button1 click handler private async void button1_Click(object sender, RibbonControlEventArgs e) { await Task.Run(new Action(func)); } // simple func void func() { var currSheet = (Worksheet) Globals.ThisAddIn.Application

What are the item criterias for the Outlook inbox conversation view of a conversation?

大憨熊 提交于 2019-12-11 17:39:39
问题 For a custom email/attachment encryption solution, during ItemAdd event for sent items folder, I am creating a copy of a mail with different body and attachments but the subject is the same. That means when you afterward look into sent items you will see two emails with different content but the same subject but only one has been sent really. Problem: When you get a reply to the one which has been really sent, in inbox conversation view you only see the one which has been really sent. But I

How to get the screen position of an active workbook?

强颜欢笑 提交于 2019-12-11 17:34:32
问题 I would center a form in an ActiveWorkbook, how to get the screen/window position of the workbook? 回答1: C# example.. private void setFormPos(Form frm) { int top = Application.Top + Application.PageSetup.TopMargin + Application.PageSetup.HeaderMargin + Application.Commandbars["Ribbon"].Height; int left = Application.Left + Application.PageSetup.LeftMargin; frm.Left = (left / 2); frm.Top = (top / 2); } 回答2: Didn't find a good solution but found an acceptable one: int top = Application.Top +