ms-office

Dynamically Display Weekday Names in Native Excel Language?

放肆的年华 提交于 2019-12-02 04:38:29
问题 I'm trying to develop an Excel financial template for an international user base that displays the weekday name as a string (i.e. today = "MON") in their native language. For English Excel versions, this is easy: =Text(Now(),"DDD") . However, I'm having a hard time finding a common solution that works for all languages of Excel. With my above Text() formula, French and German users are getting DDD return values in their cells. I've also tried =Text(Now(),"*DDD") which returns an inconsistent

Get number of pages for printing from Excel Interopb

泪湿孤枕 提交于 2019-12-02 04:28:45
How can I programatically retrieve the number of pages a workbook or worksheet will print to from the Excel 2007 Interop ( Microsoft.Office.Interop.Excel )? are you looking for ActiveSheet.PageSetup.Pages.Count ? PageSetup.Pages.Count will give the correct answer. But how to fetch the correct count if comments are printed at end of sheet. Just use "ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate:=True, IgnorePrintAreas:=False" Change "From" and "To" to your pages. 来源: https://stackoverflow.com/questions/3751468/get-number-of-pages-for-printing-from-excel-interopb

Sharing VBA modules across MS Office Applications

瘦欲@ 提交于 2019-12-02 04:04:33
I have a substantial bank of VBA modules written in an Excel 2010 add-in. Some of these are specific to Excel, but many are more general. For example one takes a part number and re-formats it; another contains a Case Select function to find a file in a network drive. I want to use the common functions in Word and Outlook. I could copy and paste from the Excel to Word add-ins, but this makes it difficult to keep my code up to date - when I make an edit in one application, I must remember to copy to all the others. My question is, is there any means of writing common code in one place (e.g. in

Cannot load local office.js

限于喜欢 提交于 2019-12-02 04:04:17
As this answer suggested, I want to modify a little bit office.js . So I copied the content of https://appsforoffice.microsoft.com/lib/1/hosted/office.js to local, such that https://localhost:3000/static/office.js shows well the content. Then, I make a very simple file test.html : <html> <head> <!--<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>--> <script type="text/javascript" src="https://localhost:3000/static/office.js"></script> </head> <body> haha </body> </html> Loading https://localhost:3000/static/test.html with remote office.js in a browser shows

Opening and storing encrypted documents offline in iOS

半世苍凉 提交于 2019-12-02 03:27:28
问题 I have encrypted files downloaded and available for offline view in a folder, I would like to know: how to open them in the appropriate reader as these are ms office docs and prezi format I suppose they will have to be unencrypted so that reader can read them but in this case how to ensure security? which folder to use to avoid iCloud sync, I already read this Disable iCloud sync Does iOS protects documents of the application by encryption based on app key as I read it or am I wrong? 回答1:

How to Fetch/Create calender by O365-iOS-Connect?

若如初见. 提交于 2019-12-02 03:22:24
I coding a iOS app using O365-iOS-Connect to connect my app to Office 365. My app can sign in to 365 account. But i can not find some docs how to Fetch/Create calender. O365-iOS-Connect Thanks and sorry for my bad english. Steps to fetch outlook calendars in iOS are: I use MSGraph SDK & Azure AD v2.0 endpoint (for personal login) Note : You must know how to install pods and check this link for details: https://graph.microsoft.io/en-us/ Steps: Register your iOS application on Microsoft Application Registration Portal and it will give you a client-id Install the following pods : pod 'MSGraphSDK

How can I get the text by color from a word document with win32com?

大城市里の小女人 提交于 2019-12-02 02:23:37
I have a word document with several tables. In each table there are two colors, black and red. I'd like to get the text from cells in a word document table by its color. I found a way, but I think it's very inefficient. The following code gets the text from a word table cell, and prints each word with it's color. import os, sys import win32com.client, re path = os.path.join(os.getcwd(),"../files/tests2.docx") word = win32com.client.Dispatch("Word.Application") word.Visible = 1 doc=word.Documents.Open(path) for table in doc.Tables: f = 2 c = 2 wc = table.Cell(f,c).Range.Words.Count for i in

Loop through each field for MS Project

ぃ、小莉子 提交于 2019-12-02 02:04:00
I am trying to loop through each field in my MS Project file and gather information about that field (custom name is particular). What is the easiest way to do this? Thanks To get the custom name of a field you'll need the field constant and to loop through all fields, you'll need to store a list of all field constants . Here is a simple example to get you started. I hard-coded an array of the field constants for the Task Text1-30 fields. Sub GetCustomFieldNames() Dim TextFields As Variant TextFields = Array(188743731, 188743734, 188743737, 188743740, 188743743 _ , 188743746, 188743747,

Office Web App - Show task pane on load

亡梦爱人 提交于 2019-12-02 01:49:50
How do I show a custom taskpane automatically when the add-in loads (i.e. without having to click a command that is tied to that URL)? Jan 2018 update: Office has shipped a new feature which lets you configure your add-in to automatically open a task pane when the file loads if the add-in had been used there previously: https://docs.microsoft.com/en-us/office/dev/add-ins/design/automatically-open-a-task-pane-with-a-document . Original Answer: Commands cannot currently be used to launch a task pane when the document opens. However, you can cause the task pane to open automatically if you remove

Accessing CustomProperties on Worksheet with Name

試著忘記壹切 提交于 2019-12-02 01:44:19
问题 I'm trying to access a custom property on a worksheet by using the name of the property, but it seems this is not supported (at least not in C#, I saw others reporting that it works in VB and documentation also says so). Can someone confirm that this is not working in C#? Here is example code: activeWorkSheet.CustomProperties.Add("Test", 123); // Accessing by index works, but by name it doesn't. // The documentation says access by name should be possible var works = activeWorkSheet