How can I create a (VSTO) Office 2007 add-in using VS 2012?

You can get VS 2012 working with Office 2007. First create an Outlook 2010 Add-In and modify the project file (.csproj) so that it will open in Office 2007 and not look for Office 2010 when run. Here is the project settings change (Outlook example): Source XPath: //Project/ProjectExtensions/VisualStudio/FlavorProperties/ProjectProperties/@DebugInfoExeName Old Value (Office 2010): DebugInfoExeName=”#Software\Microsoft\Office\14.0\Outlook\InstallRoot\Path#outlook.exe” New Value … Read more

Save modified WordprocessingDocument to new file

If you use a MemoryStream you can save the changes to a new file like this: byte[] byteArray = File.ReadAllBytes(“c:\\data\\hello.docx”); using (MemoryStream stream = new MemoryStream()) { stream.Write(byteArray, 0, (int)byteArray.Length); using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(stream, true)) { // Do work here } // Save the file with the new name File.WriteAllBytes(“C:\\data\\newFileName.docx”, stream.ToArray()); }

excel delete row if column contains value from to-remove-list

Given sheet 2: ColumnA ——- apple orange You can flag the rows in sheet 1 where a value exists in sheet 2: ColumnA ColumnB ——- ————– pear =IF(ISERROR(VLOOKUP(A1,Sheet2!A:A,1,FALSE)),”Keep”,”Delete”) apple =IF(ISERROR(VLOOKUP(A2,Sheet2!A:A,1,FALSE)),”Keep”,”Delete”) cherry =IF(ISERROR(VLOOKUP(A3,Sheet2!A:A,1,FALSE)),”Keep”,”Delete”) orange =IF(ISERROR(VLOOKUP(A4,Sheet2!A:A,1,FALSE)),”Keep”,”Delete”) plum =IF(ISERROR(VLOOKUP(A5,Sheet2!A:A,1,FALSE)),”Keep”,”Delete”) The resulting data looks like this: ColumnA ColumnB ——- ————– pear Keep apple Delete cherry Keep orange Delete plum … Read more

Microsoft Office 2007 file type, Mime types and identifying characters

Office 2007 MIME Types for IIS .docm, application/vnd.ms-word.document.macroEnabled.12 .docx, application/vnd.openxmlformats-officedocument.wordprocessingml.document .dotm, application/vnd.ms-word.template.macroEnabled.12 .dotx, application/vnd.openxmlformats-officedocument.wordprocessingml.template .potm, application/vnd.ms-powerpoint.template.macroEnabled.12 .potx, application/vnd.openxmlformats-officedocument.presentationml.template .ppam, application/vnd.ms-powerpoint.addin.macroEnabled.12 .ppsm, application/vnd.ms-powerpoint.slideshow.macroEnabled.12 .ppsx, application/vnd.openxmlformats-officedocument.presentationml.slideshow .pptm, application/vnd.ms-powerpoint.presentation.macroEnabled.12 .pptx, application/vnd.openxmlformats-officedocument.presentationml.presentation .xlam, application/vnd.ms-excel.addin.macroEnabled.12 .xlsb, application/vnd.ms-excel.sheet.binary.macroEnabled.12 .xlsm, application/vnd.ms-excel.sheet.macroEnabled.12 .xlsx, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xltm, application/vnd.ms-excel.template.macroEnabled.12 .xltx, application/vnd.openxmlformats-officedocument.spreadsheetml.template