You'll want to use Excel.Worksheet.Names foreach (Excel.Worksheet sheet in wb.Sheets) { foreach (Excel.Range range in sheet.Names) { // this is the named ranges } } Source If you were to use EPPlus, you could do this (very simple) static void Main(string[] args) { using (FileStream stream = new FileStream(@"C:\Users\bblack\Test\TestWorksheet.xlsx", FileMode.Append))...
Yes I've actually done exactly what you are trying to do. Here are some tips The excel forms actions are not threadsafe. Make sure that after you click the button that will be doing the http request that you disable all the form controls btnDownload.Enabled = false; and renable it...
I managed to solve this strange behavior. It's not the correct way of getting out the data. The correct way would be: range.get_Range(range.Cells[6, 2], (range.Cells[6, 2] as Excel.Range).get_End(Excel.XlDirection.xlToRight)) - for the first example. Hope it helps somebody......
c#,outlook,interop,office-interop
I think you need to replace this: Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); with this: Outlook.MailItem oMailItem = oApp.CreateItem(Outlook.OlItemType.olMailItem); Also, if this code is in an add-in, you don't need to create a new instance of Outlook.Application - use the object passed to the OnConnection event....
c#,office-interop,ribbon,excel-addins
You can't manage the process of loading ribbon controls. But you can change visibility of your controls at runtime. The IRibbonUI interface provides the Invalidate and InvalidateControl methods that allow to trigger your callbacks where you can change visibility at runtime (getVisible). In the following example, starting the host application...
c#,excel,ms-office,office-interop,excel-interop
Got it! application.Workbooks != application.Workbooks This property doesn't expose a variable, it generates a value. So every time I access the Workbooks property I create a new COM object. I fixed the code and all is well. Thanks, everybody. var excelApplication = new Application(); var workbooks = excelApplication.Workbooks; var workbook...
I asked the same question on MSDN forums and was given this great answer. I hope that this can help people in the future. static Application onenoteApp = new Application(); static XNamespace ns = null; static void Main(string[] args) { GetNamespace(); string notebookId = GetObjectId(null, OneNote.HierarchyScope.hsNotebooks, "MyNotebook"); string sectionId =...
c#,html,ms-word,office-interop
The macro recorder is your friend. Instead of InsertFile, use InlineShapes.AddOLEObject instead. See https://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.inlineshapes.addoleobject%28v=office.11%29.aspx. I just recorded embedding a Word object and this is what I got: Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.12", _ FileName:=[pathToMyFile], LinkToFile:= _ False, DisplayAsIcon:=True, IconFileName:= _ "C:\PROGRA~2\MICROS~1\Office14\WINWORD.EXE", IconIndex:=1, IconLabel:= _ [myFileName] ...
c#,excel,vba,excel-vba,office-interop
Coopernick, It looks like you need to develop an Excel add-in and move the VBA code on the add-in rails. See Walkthrough: Creating Your First Application-Level Add-in for Excel to get started quickly. You may consider an Excel add-in as a regular .Net application where you can use any components...
c#,excel,office-interop,worksheet
Your current solution seems inefficient to me... It sounds like all you're trying to do is clear your sheet.... Try deleting Cells... foreach (Excel.Worksheet sheet in m_objExcel.Sheets) { if (sheet.Name == "Before & After Lube Weight") { sheet.Cells.Delete(); } } If still, you want to delete your sheet then remember...
c#,.net,ms-word,office-interop,word-2010
As the error message indicates, you need a reference to the Word.Application object to access this method, since it is not static. I guess you have a oWordApp somewhere that you use to create or open the oWordDoc, so you can access the method from this object. Or you can...
c#,arrays,excel,office-interop
Add this helper method. It assumes that if columnNumber is set to 1 that this represents column "A". Value 2 represents "B" etc.: private string GetExcelColumnName(int columnNumber) { int dividend = columnNumber; string columnName = String.Empty; int modulo; while (dividend > 0) { modulo = (dividend - 1) % 26;...
vba,ms-word,office-interop,word-vba
Try this: Sub ReplaceHighlightedTextColor() Dim rng As Range Set rng = Selection.Range With rng.Find .ClearFormatting .Highlight = True While .Execute(Forward:=True, Format:=True) 'Note: 'rng' is now the range containing the matched content rng.Text = rng.FormattedText.HighlightColorIndex Wend End With End Sub ...
c#,outlook,office-interop,exchangewebservices,exchange-server-2010
You can either wait until the sync finishes - use Namespace.SyncObjects collection, retereive the first SyncObject object, call SyncObject.Start and wait for the SyncObject.SyncEnd event to fire. On the Extended MAPI level (C++ or Delphi) or Redemption (it wraps Extended MAPI and can be used in any language), open the...
It depends on what exactly you need to implement in the code... Open XML SDK. See Welcome to the Open XML SDK 2.5 for Office for more information. You can find various third-party components on the web. Try searching for any of them. Don't want to advertise any. ...
xml,ms-word,ms-office,office-interop,word-vba
case "DocumentFormat.OpenXml.Wordprocessing.SdtBlock": SdtBlock p1 = (SdtBlock)DocElement; content1 = p1.InnerText; IEnumerable<Paragraph> pp = p1.Descendants<Paragraph>(); foreach (Paragraph para in pp) { style= GetParagraphStyleId(para); } where GetParagraphStyleId(para) has public string GetParagraphStyleId(Paragraph p) { string ParaStyleIdValue = string.Empty; if (p.ParagraphProperties != null) { if (p.ParagraphProperties.ParagraphStyleId != null) { if (p.ParagraphProperties.ParagraphStyleId.Val != null) {...
Finally I have found a way to get out powerpoint presentation titles from .ppt file without converting it to .pptx. Here is a solution: using System; using System.Collections.Generic; using Microsoft.Office.Core; using PowerPoint = Microsoft.Office.Interop.PowerPoint; namespace Mintra.Publisher.DocumentConverter.Core.Utils { class InteropUtility { public static IList<string> GetPresentationTitles(string pptPath) { IList<string> result = new...
c#,sql-server,excel,office-interop
OPENROWSET is the best if your working with SQL Server, much faster implementation compared to Interop. Example implementation for export\import and creating new Excel file....
c#,sharepoint,office-interop,onedrive
According to this post, the synced folders can be looked up in this multi-string registry value: HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common \Internet\LocalSyncClientDiskLocation Given that your local path and SharePoint URL look like C:\Users\User\SharePoint\Library - Documents\Folder\SubFolder\Document.pptx and https://***.sharepoint.com/Library/Shared%20Documents/Folder/SubFolder/Document.pptx, you could try extracting the local part Folder/SubFolder/Document.pptx from the URL, add it to the local folder...
c#,ms-word,office-interop,tableofcontents
This seems to be explained in the documentation: "The Document.TablesOfContents Property returns a TablesOfContents collection that represents the tables of contents in the specified document." Once you have that, "Use TablesOfContents(index), where index is the index number, to return a single TableOfContents object. The index number represents the position of...
.net,file,ms-office,office-interop
The most significant part of Trid is actually written in .NET - I'd contact him directly, send a donation his way, and ask him nicely if he can share his .NET assembly or similar with you. See http://mark0.net/code-tridengine-e.html If you remove or relax your .NET requirement, or won't blink at...
c#,excel,com,office-interop,ole
MSForms controls foreach (Shape s in ws.Shapes) { //s.FormControlType.ToString(); } ActiveX controls foreach (Shape s in ws.Shapes) { //s.OLEFormat.progID.ToString(); } Even though they are shapes in Excel, they are actually all OLEObjects for C# and it's better to treat them that way too (less casting cause COM treats them originally...
excel,vba,ms-office,powerpoint,office-interop
My colleague found a great solution that satisfies our needs perfectly, although it did involve using a color theme so I kind of went outside the scope of my question. You can export a theme with the desired colors, get the theme's XML in %USERPROFILE%\AppData\Roaming\Microsoft\Templates\Document Themes\Theme Colors and then distribute...
outlook,office-interop,outlook-addin,outlook-2010,outlook-2007
Touching a message marked for submission with OOM or the Outlook Object Model aborts the submission process. Can you exclude messages in the Outbox folder?...
c#,ms-word,vsto,office-interop,word-interop
It looks like you forgot to set the Visible property of the Application class. See How to automate Microsoft Word to create a new document by using Visual C# for more information....
windows-installer,vsto,office-interop
A PIA doesn't have anything to do with performance. It only contains declarations, [ComImport]s for the interfaces and co-classes in the Office object model. The CLR needs them to know how to make a call to them. A PIA could be necessary in the olden days if one of your...
c#,sharepoint-2010,ms-word,clickonce,office-interop
I figured out my problem, need to give a bit more background to explain the issue a bit better. I'm using a number of Action Panes to create a wizard-like experience for the user. When the user hits "Next" on the first pane I have code (using ThisDocument.SaveAs2) so automatically...
I found the solution, I had one table in one specific tab and wanted the right click context for that, where i specify it in the if statement if the sheet is the one i need and the selected range intersects with the table range it adds the right click...
c#,text,powerpoint,office-interop,file-conversion
It looks like you need to check your shape objects to see if they have a TextFrame and Text present. In your nested foreach loop try this: foreach (Microsoft.Office.Interop.PowerPoint.Slide slide in pp.Slides) { foreach (Microsoft.Office.Interop.PowerPoint.Shape shape in slide.Shapes) { if(shape.HasTextFrame == Microsoft.Office.Core.MsoTriState.msoTrue) { var textFrame = shape.TextFrame; if(textFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue)...
c#,ms-word,powerpoint,office-interop,word-interop
You should use the Languages property to get the collection of languages. _Application.Languages Property Returns a Languages collection that represents the proofing languages listed in the Language dialog box. Here _Application represents the Microsoft Office Word application....
The following works for me (tested with Access 2010): accessApp.DoCmd.OpenReport( "Report1", Microsoft.Office.Interop.Access.AcView.acViewDesign); Microsoft.Office.Interop.Access.Report rpt = accessApp.Reports["Report1"]; rpt.RecordSource = "SELECT * FROM Clients WHERE ID<=3"; accessApp.DoCmd.OutputTo( Microsoft.Office.Interop.Access.AcOutputObjectType.acOutputReport, "", "PDF Format (*.pdf)", @"C:\Users\Gord\Desktop\zzzTest.pdf", false, null, null, Microsoft.Office.Interop.Access.AcExportQuality.acExportQualityPrint); // now...
c#,office-interop,novacode-docx
Looking at the DocX source code of the Formatting in class I would say that you're looking for Highlight. So if you wanted something highlighted in blue rb.Highlight = Highlight.blue; Edit: This seems to have been already answered in this question http://stackoverflow.com/a/30141775/2039359...
c#,email,outlook,office-interop
I'm not sure what kind of data you have in the data table. But if its just a simple text table you could use the html table tag in your htmlBody. Just create a simple loop trough the columns of the data table to create your header row and then...
.net,visual-studio,ms-office,vsto,office-interop
Nope. Because .Net is not the only thing required for VSTO add-ins. Office add-ins are based on the COM technology which doesn't exist on the Mac.
c#,outlook,office-interop,com-interop,outlook-2010
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. If you are building a solution...
You're right in that Microsoft discourages Excel automation in web applications: https://support.microsoft.com/en-us/kb/257757?wa=wsignin1.0 You still have some options, though. If all you need to do is export data, you can still write a file in CSV format for your export, and it should open in Excel. If you really need to...
Finally I got the magical solution. I just created two folders in the Windows 2008 Server C:\Windows\SysWOW64\config\systemprofile\Desktop and C:\Windows\System32\config\systemprofile\Desktop And after applying read permission to the folders, the ppt is getting save in the local directory of the server. Source...
Thanks to all for supporting, I found the answer of the question. foreach (Word.Paragraph firstItem in document.Content.ListParagraphs.OfType<Word.Paragraph>().Reverse()) { if (firstItem.Range.ListFormat.List != null) { foreach (Word.Paragraph item in firstItem.Range.ListFormat.List.ListParagraphs) { } } } ...
What is your definition of "duplicate"? Do you consider duplicate 2 emails with the same subject but different bodies? Same body/subject but different dates? The exact de-duping algorithm will depend on what you consider a dupe....
html,pdf,outlook,office-interop
Yes, it is possible. Outlook uses Word as an email editor. So, you can use the Word object model to get the job done. The WordEditor property of the Inspector class returns an instance of the Document class from the Word object model which represents the message body. See Chapter...
c#,dynamic,plugins,outlook,office-interop
The Application class from the Outlook object model provides the CreateItem method. You may find a sample code in the following articles written by me: How To: Create a new Outlook Appointment item How To: Create a new recurring Outlook Appointment item ...
ms-office,windows-server-2008,office-interop
Microsoft Office supports Windows Server OS - feel free to install it on your server. But it doesn't support automation on the Server server side. The Considerations for server-side Automation of Office page states the following: Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications...
c#,outlook,interop,office-interop,com-interop
You would need to call IAttach::OpenProperty(PR_ATTACH_DATA_OBJ, IID_IStorage, ...) then open a particular stream from IStorage that contains the data that you are after. Note that the stream and its format are specific to the application that created the OLE attachment. Redemption supports Word Pad, Paint Brush, Excel, Power Point, Word,...
com,ms-word,office-interop,asp.net-mvc-6
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. If you are building a solution...
c#,asp.net-mvc,excel,office-interop
first thing i noticed is that your using forward slashes (/) instead of backslashes \
c#,winforms,office-interop,excel-interop
Those are the "Primary Interop Assemblies" and are required: Some assemblies are added to a project automatically when an assembly that references them is added. For example, references to the Office.dll and Microsoft.Vbe.Interop.dll assemblies are added automatically when you add a reference to the Word, Excel, Outlook, Microsoft Forms, or...
c#,vb.net,office-interop,excel-interop
You have to install, in this order: Microsoft Office Visual Studio Tools for Office which installs the PIA's, this installs all the assemblies you need Are you sure you are looking for version 9? This is for Office 2000....
Firstly, check if PR_RECEIVED_BY_ENTRYID property is present (you can do that in OutlookSpy - click OpenIMsgOnIStg). If it is present, read the PR_RECEIVED_BY_ENTRYID property (DASL name http://schemas.microsoft.com/mapi/proptag/0x003F0102) using PropertyAccessor.GetProperty, convert it to a hex string using PropertyAccessor.BinaryToString, then use it to call Namespace.GetAddressEntryFromID. You can then retrieve the current name...
You need rng.Find.Font.Underline = wdUnderline.wdUnderlineSingle; (At the moment you are setting the formatting for the specified rng, rather than the formatting for the Find)...
To generate an Excel file from your .NET code, you might prefer to use a library like CloseXML (https://closedxml.codeplex.com/) that works with the underlying file format directly.
c#,office-interop,word-interop
In case anyone having a similar problem is looking for a solution, I placed a bookmark below the table, moved the selection cursor there, then selected the range just before the bookmark and pasted. Word.Bookmark bkmrk = document.Bookmarks["MyBkmrk"]; Word.Range rng = document.Range(bkmrk.Range.Start - 1, bkmrk.Range.Start - 1); rng.Select(); word.Selection.Paste(); This...
c#,powerpoint,office-interop,cursor-position
With ActiveWindow.Selection.TextRange .InsertAfter ("D") End With ...
python,replace,ms-word,office-interop,win32com
You must activate header/footer pane after open document. Language Visual basic. Change syntax to pyton ActiveDocument.ActiveWindow.Panes(1).View.SeekView=wdSeekCurrentPageHeader for header and ActiveDocument.ActiveWindow.Panes(1).View.SeekView = wdSeekCurrentPageFooter for footer Then search/replace To change pane to main part use ActiveDocument.ActiveWindow.Panes(1).View.SeekView = wdSeekMainDocument ...
c#,visual-studio,f#,office-interop
There is no generic reference for Office, rather, they are application specific. Under the COM tab, you can add a refernce to any of the following. The version number will vary based on the version of Office you have installed. Microsoft Excel 14.0 Object Library Microsoft Outlook 14.0 Object Library...
If you are accessing multiple Mailboxes, you have to first ensure that they are both loaded in the current Outlook profile. Otherwise, you need to ensure that the currently logged on user has delegate access to the Mailbox you want to access and use the NameSpace.GetSharedDefaultFolder method to open their...
c#,vb.net,outlook,ms-office,office-interop
You need to convert to VB's event wireup format: AddHandler _explorer.BeforeFolderSwitch, AddressOf Explorer_BeforeFolderSwitch Note that the explicit delegate construction is unnecessary....
c#,math,ms-office,powerpoint,office-interop
Here i got the solution and that is the concept of Copy and Paste.
c#,excel,charts,office-interop
Points index is from 1. And are you sure you have a 4th point in your chart? I used ((Excel.Point)((Excel.Series)expchart.Chart.SeriesCollection(iseries)).Points(ipoint)).Format.Fill.ForeColor.RGB = System.Drawing.Color.FromArgb(160, 160, 160).ToArgb(); and it works....
On the contrary, Microsoft's advice is very much not to use it: Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when...
I was successful in obtaining the formula by: string fontSize = shape.CellsSRC[(short) Visio.VisSectionIndices.visSectionCharacter, (short) Visio.VisRowIndices.visRowCharacter, (short) Visio.VisCellIndices.visCharacterSize].Formula; Or by: string fontSize = shape.CellsSRC[3,0,7].Formula; Which is practically the same, only not very readable, Or by: string fontSize = shape.get_Cells("Char.Size").Formula; ...
c#,.net,interop,office-interop,excel-interop
The problem was a DCOM configuration issue. All the appropriate permissions were set, but the application was not configured to run as the interactive user. I suspect that this problem is relatively uniquely identified by the combination of being able to launch the process but not being able to connect...
c#,email,outlook,office-interop
You cannot get child or parent folders of a delegate folder obtained by GetSharedDefaultFolder. You would need to have that user granted Full Mailbox access on the required Exchange Mailbox and then add that Mailbox to the current Outlook profile. All the folders in that Mailbox will then be available...
Why not create a copy of the document before you open it? For example, lets say you're going to modify c:\docs\myfile.docx using your script, and you want to save the modified version as c:\newdocs\newfile.docx. Before opening Word in your script, do a File.Move("c:\docs\myfile.docx", "c:\newdocs\newfile.docx"); and then open the target file,...
c#,interface,com,office-interop
It's because it's a COM interface. COM interfaces - and only COM interfaces - can be instantiated directly. The runtime will create an instance of the real type behind the scenes. Personally I think it's a bit ugly (and I can't find any references to it in the C# spec)...
vb.net,ms-word,office-interop,word-interop
OK So I found what was the problem and found how to fix it. Basically, when you first replace the content, the selection (aka the "zone" where the Word Interop App will make its search by the Find property) is reset, which makes it can't find what we are looking...
c#,outlook,office-interop,office-2013
Try to use the following code instead: oApp = Activator.CreateInstance(Type.GetTypeFromProgID("Outlook.Application")) as Microsoft.Office.Interop.Outlook.Application; It looks like something is wrong with the windows registry records. Take a look at the similar forum thread - Error: Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'.. Do you have the Click2Run...
c#,.net,ms-word,office-interop
So I found out the answer, i just needed to use: tempRow.AllowBreakAcrossPages = 0; ...
found a simple solution with OLE File Property Reader var doc = new OleDocumentPropertiesClass(); doc.Open(ExcelFilePath, false, dsoFileOpenOptions.dsoOptionDefault); string DocFileVersion = doc.SummaryProperties.Version.ToString(); this will return version of Application Version of excel file......
If you know the cell you want to check, for example A1, you can do it like this: using System; using System.Runtime.InteropServices; using Excel = Microsoft.Office.Interop.Excel; namespace Test { class Program { static void Main(string[] args) { // create app var excelApp = new Excel.Application(); // open workbook var workbook...
c#,outlook,interop,office-interop
It is not possible to use the Interop assemblies without its associated application installed where you need to use it. The Interop assemblies are used primarily as an advanced application automation system. If you are using Exchange Server 2007 or later, you could consider using the technique described in this...
c#,office-interop,outlook-addin
The object that raises the events (Items collection) must be kept alive to be able to raise events. You are using multiple dot notation and as soon as an implicit variable created by the compiler goes out of scope and gets garbage collected, no events will be raised: public class...
I used Page Breaks for each section.
I think I got what you want. When pasting the new slide, save the new SlideRange. Afterwards assign the design of the source slide. PowerPoint.Application ppApp = Globals.ThisAddIn.Application; PowerPoint.SlideRange ppslr = ppApp.ActiveWindow.Selection.SlideRange; string desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); var temporaryPresentation = Globals.ThisAddIn.Application.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoTrue); Microsoft.Office.Interop.PowerPoint.CustomLayout customLayout =...
It turns out that Word uses Vertical Tabs for its line breaks. I was able to add them using the "\v" character to ranges. See What is a vertical tab? for more details.
powershell,office-interop,visio,powershell-v4.0,visio2013
You can try this: $visio = New-Object -ComObject Visio.InvisibleApp $visio.Quit() Note that it's not a must to use Add-Type (however you can go also with Add-Type, in this case try Microsoft.Office.Interop.Visio.InvisibleAppClass BTW, there is a library for using Visio from PS: https://visioautomation.codeplex.com/...
c#,excel,office-interop,export-to-excel,excel-interop
Try changing NumberFormat to text: workSheet.Cells[i + 1, 7].NumberFormat = "@"; workSheet.Cells[i + 1, 7] = list[i].Code; Actually I suggest you to do it for entire range: workSheet.Range["G1","G100"].NumberFormat = "@"; and then in loop: workSheet.Cells[i + 1, 7] = list[i].Code; ...
sharepoint,sharepoint-2010,ms-office,office-interop,excel-interop
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. If you are building a solution...
asp.net,vb.net,outlook,office-interop
No Office app (including Outlook) can run in a service (such as IIS). Your options are Extended MAPI (C++ or Delphi only), Redemption (which wraps Extended MAPI and can be accessed from any language, including C#), EWS (Exchange only) or straight SMTP.
c#,vba,ms-word,office-interop,word-vba
The below statement would get you the color index of selected text in MS Word Dim objSelection As Selection Set objSelection = Application.Selection Msgbox objSelection.FormattedText.HighlightColorIndex The value returned is one of wdColorIndex enumeration. List of values in enumeration can be seen here https://msdn.microsoft.com/en-us/library/bb237561(v=office.12).aspx Update#1 Below code is using ActiveDocument.Range.Find as...
visual-studio-2010,vsto,office-interop,installshield,excel-addins
I'd suggest not to attempt to rename or merge the .vsto and .manifest file names. I cannot see a scenario in which renaming this files can be beneficial. While it is possible, there are multiple places which reference these files by their name and you would have to find all...
c#,selenium-webdriver,ms-word,office-interop
I have modified the code with below.I am passing range object which solving my problem as of now.Still looking for better solution if there any. object o_CollapseEnd = WordC.WdCollapseDirection.wdCollapseEnd; WordC.Range imgrng = aDoc.Content; imgrng.Collapse(ref o_CollapseEnd); imgrng.InlineShapes.AddPicture(imgFilename, Type.Missing, Type.Missing,imgrng); ...
.net,visual-studio-2010,c#-4.0,office-interop
You need to use the Excel object model methods and properties instead. There is no Global class outside VSTO add-ins (belongs to the VSTO runtime only). It looks like you need to automate Excel from another application. See How to automate Microsoft Excel from Microsoft Visual C#.NET for more information....
c#,outlook,webbrowser-control,add-in,office-interop
Note, you develop an add-in, not a standalone applicaton. The only possible scenario is to set a keybord hook. See Using shortcut keys to call a function in an Office Add-in for more information.
c#,outlook,office-interop,office365
After many OutlookSpy craches I found this :) To get custom attribute number 6 you must call: var prope = user.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x8032001E"); Attribute: #7 = 0x8033001E #8 = 0x8034001E ... ...
vb.net,visual-studio,vsto,openxml,office-interop
DocumentFormat.OpenXml.dll is part of the Office Open XML SDK. There's no reason for your clients to install the whole SDK. So yes, you have to ship DocumentFormat.OpenXml.dll to them by setting CopyLocal to True. WindowsBase.dll is part of the .NET Framework so you don't have to manually include this one....
c#,.net,visual-studio-2010,add-in,office-interop
Yes, that is possible. You possibly need 3 different AddIn classes, since every platform has it's own format and parameters and you might want to deviate some logic, though there is nothing to stop you integrating the three add-ins in one. Another option is to make a class library that...
c#,excel,office-interop,excel-interop
In your inner loop you add a new worksheet to your 'finalized' workbook ('sheet') AND copy a worksheet before it for every source sheet. So every 'sheet' created by your Add command will be empty as in fact you create two sheets for each source sheet. Another problem is, that...
c#,powerpoint,office-interop,office-addins
After calling DoDragDrop with a String.Empty first parameter, it is possible t get the current cursor coordinates. Getting the coordinates needs some Win32 boilerplate: [StructLayout(LayoutKind.Sequential)] public struct POINT { public int X; public int Y; public POINT(int x, int y) { this.X = x; this.Y = y; } } class...
try placing in the workbook Open event handler: Application.AskToUpdateLinks = False ...
vsto,office-interop,powerpoint-vba
Unless there's no way around it, NEVER select slides or shapes. And there's almost never a situation where you need to select them. In VBA, if you want to work with something on Slide 10: Dim oGrpShp as shape With ActivePresentation.Slides(10) ' And here you could work with the slide's...
winforms,drag-and-drop,outlook,office-interop
In the Drag event handler add the following line of code: e.Data.GetData(“RenPrivateMessages”); ...