ms-office

Launch Infopath form with parameter

空扰寡人 提交于 2020-01-03 05:28:27
问题 Opening an Infopath form with parameter can be done like this: System.Diagnostics.Process.Start(PathToInfopath + "infopath.exe", "Template.xsn /InputParameters Id=123"); But that requires I know the path to Infopath.exe which changes with each version of Office. Is there a way to simply launch the template and pass a parameter? Or is there a standard way to find where Infopath.exe resides? 回答1: Play around with System.Diagnostics.ProcessStartInfo which allows you to specify a file you wish to

Accessing other user calendar using service account

大城市里の小女人 提交于 2020-01-03 05:25:09
问题 We are trying to integrate office 365 using EWS managed API's. We have created one service account with impersonation role using office 365 admin center. Now, how can we use that service account to access other user's data(like mails, contacts, calendar) in the application ? Thanks, Rohit 回答1: You create an instance of ExchangeService as usual and then set its ImpersonatedUserId. Sample: var credentials = new WebCredentials( "impersonateduser@your.onmicrosoft.com", "password", ""); var

VSTO with Windows Form and Worker Threads

浪尽此生 提交于 2020-01-03 05:04:45
问题 I have an Office addin (Outlook if it makes a difference) created with VSTO. The addin creates a Windows Form at startup. My Form creates several threads. I'm looking for either concrete guidance or peoples' experiences with what safely works for the following situations: 1.) A thread created by the Form needs to access the Office object model (Globals.ThisAddIn.Application) 2.) A thread created by the Form does not need to access the Office object model, but does need to update a control on

Input Desired on Converting Office Documents to PDF

别来无恙 提交于 2020-01-03 02:52:29
问题 I am trying to convert [from a command line, or a class library in c#] a document, excel file, etc. to a pdf. Without using Interop or having any office products installed on the machine. Has anyone done such a thing? Or have any ideas? All of the solutions we have come across seem to require interop Thanks 回答1: See this article if it helps: Convert and Merge Office Files to One PDF File in C# using System.Drawing; using System.Windows.Forms; using Spire.Pdf; using Spire.Doc; using Spire.Xls;

How to Import Excel Worksheet into Microsoft Project?

江枫思渺然 提交于 2020-01-02 07:14:27
问题 I want to import the following Microsoft Excel worksheet into Microsoft Project (2010): Essentially, the worksheet has tasks and subtasks in column A, Start Dates in column B, and Finish Dates in column C. The conditional highlighting you see is based off the start and finish dates. There are no macros, only formulas, so the spreadsheet is saved as a normal Excel workbook. I tried to open the workbook in Project. It correctly finds the source worksheet name, but it doesn't recognize any

How to make an excel cell ReadOnly using C#?

余生长醉 提交于 2020-01-02 02:51:34
问题 Range range= (Range)this.workSheet.Cells[1,1]; range.AllowEdit = false; When I set the AllowEdit property to false, a compile error will show: Error: Property or indexer 'Microsoft.Office.Interop.Excel.Range.AllowEdit' cannot be assigned to -- it is read only How can I set the range of cells to be Read Only? When I am using validation for this range I got Some exception on my CellContentChanged Event . Here is the code which is in CellContentChanged: var updater = new Action<StyleColorItem>(

Embedding Office files (.doc, .ppt, .xls) in my Android App

﹥>﹥吖頭↗ 提交于 2020-01-01 19:17:39
问题 Is there a way to embed any kind of a viewer (for exapmle, QuickOffice Viewer) inside an Android App, in order to view/show/edit Documents such as .docx, pptx, xlsx, etc. (Word, Excel, PowerPoint files) ? Any SDK or any API to present those without leaving to another app ? A.K.A I don't want my files & data to leave my app, but I want them be presented to the user :) 回答1: There is Apache POI. The Apache POI Project's mission is to create and maintain Java APIs for manipulating various file

MS Office 2013 - VBA password security [duplicate]

心已入冬 提交于 2020-01-01 18:19:16
问题 This question already has answers here : Is there a way to crack the password on an Excel VBA Project? (22 answers) Closed 4 years ago . I am wondering about how safe is the VBA password on MS Office 2013. I've searched online and there are a bunch of websites selling software to do it, is it reliable? I want to develop some security around my office files that would depend on the VBA code inside, but if the vba code inside can be easily changed/seen it's non sense going that way. Thanks 回答1:

How do you dynamically create controls on a MS Access form?

南楼画角 提交于 2020-01-01 17:09:53
问题 I am writing a survey (data input) form in MS Access. I need to dynamically display all the questions in the questions table in labels on my form. Each of these question labels will also be accompanied by a combo box that will display possible answers. How can I add labels to a form dynamically? 回答1: See the CreateControl Method. For a label, use acLabel from the AcControlType Enumeration as the ControlType parameter for CreateControl. However, this will get more complicated. In addition to

MSOFFICE MIME type verification

一世执手 提交于 2020-01-01 09:03:04
问题 I have the following: $mimeTypes = array('application/msword'); //used to be an array $finfo = new finfo(FILEINFO_MIME, "/usr/share/misc/magic"); $type = $finfo->file($_FILES['userfile']['tmp_name']); $mime = substr($type, 0, strpos($type, ';')); if (in_array($mime, $mimeTypes)) { //let it in The problem is that I am getting "application/vnd.ms-office" as the filetype for any MSOFFICE file that I attempt to upload. I DO NOT wish to allow all MSOFFICE files, only .DOC's. Is there a workaround