ms-office

How to use Office from Visual Studio C#?

时间秒杀一切 提交于 2019-12-04 10:39:20
问题 The technique for adding a reference to the COM interop of Office in Visual Studio is to go to: References Add Reference Select the COM tab Select Microsoft Office 11.0 Object Library And magically named reference appears: Microsoft.Office.Core The Project.csproj file shows the details of the reference: <COMReference Include="Microsoft.Office.Core"> <Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid> <VersionMajor>2</VersionMajor> <VersionMinor>3</VersionMinor> <Lcid>0</Lcid> <WrapperTool

Add-ins do not show up under 'Admin Managed' after deploying them to the Office 365 Admin Centre

时光毁灭记忆、已成空白 提交于 2019-12-04 10:22:05
After deploying a Word Add-in via centralised deployment, it doesn't show up in Word. We used this procedure to deploy the add-in and it lists it there succesfully. Because we were worried it may be due to something wonky with our own plugin, we then decided to try to deploy the 'Contoso Citations' plugin which is used in the same procedure and screenshots here . After capturing traffic whenever we press 'Update' under the Add-in Admin Managed dialog, we noticed a connection to Exchange. We then captured the traffic using a proxy and some root certificates, and we found the following call:

How to return the value in one field based on lookup value in another field

只愿长相守 提交于 2019-12-04 10:11:31
This is basic stuff, but I'm somewhat unfamiliar with VBA and the Word/Access object models. I have a two column database of about 117000 records. The columns are 'surname' and 'count'. I want a user to be able to type SMITH in a textbox and hit submit. I then want to run something like SELECT table.count FROM table WHERE surname = string and return the value of table.count in a string. It feels like this should be five or six lines of code (which I have but won't post) but I'm obviously missing something! Cheers First of all, be careful naming the column 'count' -- this is a keyword in SQL

Building an OCX with VS.NET?

你离开我真会死。 提交于 2019-12-04 09:34:19
What happened to OCX's? Are they no longer possible to create with the latest tools? I need to create an ActiveX control that I can place in Word, PowerPoint and Excel documents. If I use VS.NET, I can only create a UserControl DLL with COM Interop, but I don't think I can add that using the "More Controls" toolbox of PowerPoint's Developer Tab. What would you do? Yes, you can still create them. But you can't create an OCX with a .NET language. Need to be unmanaged C++ (or VB). The DLLs with COM interop you can create in C# or VB.NET are just .NET objects that are invoked via CCW. You can

How to position Outlook 2007/2010 VSTO Context Menu Button?

只愿长相守 提交于 2019-12-04 09:26:37
I have an Outlook 2007/2010 add-in where I have successfully added a context-menu button to the explorer. The button itself is displayed correctly and working fine however I am unable to position it above the built-in controls on the context-menu, it is always added to the bottom. I have created the same button using VSTO 3.0 for an Outlook 2003 add-in and the same code creates a button that is at the top of the context menu above the 'Open' button. My code is below void Application_ItemContextMenuDisplay(CommandBar CommandBar, Selection Selection) { if (Selection.Count != 1) return;

Oauth2 for SharePoint 365 REST

谁说我不能喝 提交于 2019-12-04 08:38:59
问题 I'm trying to connect to Sharepoint Online (Sharepoint 365?) content using OAuth2 and the REST API. I need to do this from Python as it is an addition to an existing application. I have already managed to connect the application to Google Drive using OAuth2 and REST, so I think I understand the fundamentals of using OAuth2. I've tried a number of combinations of places to configure the client_id and client_secret and authenticate and receive access and refresh tokens. So far I have been able

Can someone confirm how Microsoft Excel 2007 internally represents numbers?

走远了吗. 提交于 2019-12-04 08:36:41
I know the IEEE 754 floating point standard by heart as I had to learn it for an exam. I know exactly how floating point numbers are used and the problems that they can have. I can manually do any operation on the binary representation of floating point numbers. However, I have not found a single source which unambiguously states that excel uses 64 bit floating point numbers to internally represent every single cell "type" in excel except for text. I have no idea whether some of the types use signed or unsigned integers and some use 64 bit floating point. I have found literally trillions of

C# COM Office Automation - RPC_E_SYS_CALL_FAILED

自闭症网瘾萝莉.ら 提交于 2019-12-04 08:26:09
I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throw a COMException with the message RPC_E_SYS_CALL_FAILED . I couldn't find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to do with the message queue or Single-Threaded Apartments. Or am I way off? Example of the error message is: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)) at Microsoft.Office.Interop.PowerPoint._Presentation.get_FullName() Unfortunately, the

How can I start MS Office Word from .NET without Add-ins?

有些话、适合烂在心里 提交于 2019-12-04 08:21:51
I'm using MS Office 2003 PIA to create a MS Word document from c#. ApplicationClass officeApplication = new ApplicationClass(); Is there any way to specify that I don't want any office add-ins to be loaded using this method? EDIT: I know that one can do this via command line so I'm pretty sure there must be a way to do it from code: "C:\Program Files\Microsoft Office\Office11\Winword.exe" /a This code unload the AddIns officeApplication.AddIns.Unload(false); Edited: When you need to mix the process start and possibility to use the office "application" interface, you need the Marshal

Counting emails in outlook by date

久未见 提交于 2019-12-04 07:37:27
I Have the following code to count the number of emails in a outlook folder. Sub HowManyEmails() Dim objOutlook As Object, objnSpace As Object, objFolder As Object Dim EmailCount As Integer Set objOutlook = CreateObject("Outlook.Application") Set objnSpace = objOutlook.GetNamespace("MAPI") On Error Resume Next Set objFolder = objnSpace.Folders("Personal Folders").Folders("Inbox").Folders("report's").Folders("Customer") If Err.Number <> 0 Then Err.Clear MsgBox "No such folder." Exit Sub End If EmailCount = objFolder.Items.Count Set objFolder = Nothing Set objnSpace = Nothing Set objOutlook =