ms-office

Python: Refresh PivotTables in worksheet

不问归期 提交于 2019-11-30 07:12:37
I'm building a python script that will allow me to open a Excel 2010 worksheet and print it out. I got most of the way import win32com.client office = win32com.client.Dispatch("Excel.Application") wb = office.Workbooks.Open(r"path\to\excel\file\to\print.xlsm") count = wb.Sheets.Count for i in range(count): ws = wb.Worksheets[i] pivotCount = ws.PivotTables().Count for j in range(1, pivotCount+1): #TODO code to refresh each pivot table ws.PrintOut() print "Worksheet: %s - has been sent to the printer" % (ws.Name) As you can see I'm still missing the refreshing of the pivot tables in the

programatically convert word docx to doc without using ole automation

空扰寡人 提交于 2019-11-30 07:00:50
问题 i'm looking for a way to programatically convert word documents in docx format to doc format without using ole automation. i already have a windows service that does this but it means installing office on a server and it is a little unreliable and not supported. i am aware of the aspose.words product, and i will try it out, but has anyone any recommendations for how to do this as simply, reliably, and cheaply as possible? 回答1: One option without using OLE automation would be to wrap the

Office HTML Word header

南楼画角 提交于 2019-11-30 05:26:53
I am generating "Word document" with a header on the first page as HTML code. <style> tag contains: @page Section { size:8.5in 11.0in; margin: 0.7in 0.9in 0.7in 0.9in; mso-header-margin: 0.0in; mso-footer-margin: 0.0in; mso-title-page: yes; mso-first-header: fh1; mso-paper-source: 0; } div.Section { page: Section; } and <body> : <div class="Section" style="font-family: Verdana, sans-serif;"> <![if supportFields]> <div style="mso-element:header" id="fh1"> <p class="MsoHeader"> header </p> </div> <![endif]> </div> It shows the "header" text both in header and in the document's main body. The

Programmatically Determine If An Excel File (.xls) Contains Macros

只谈情不闲聊 提交于 2019-11-30 04:38:56
问题 Is there any way to programmatically determine if an .xls contains macros, without actually opening it in Excel? Also are there any methods to examine which certificate (including timestamp cert) these macros are signed with? Again without using Excel. I'm wondering in particular if there are any strings that always show up in the raw data of an Excel file when macros are present. 回答1: Yes, you can open the .xls file as a compound document file and check whether is contains a VBA folder and

Installing Office Customization

て烟熏妆下的殇ゞ 提交于 2019-11-30 04:18:42
Name: From: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto ************** Exception Text ************** Microsoft.VisualStudio.Tools.Applications.Deployment

Looking up the value for MS Office Interop constants rather than hard coding them

我怕爱的太早我们不能终老 提交于 2019-11-30 04:14:09
问题 Using PowerShell, it is easy enough to create, say, an instance of the Excel Application class and start manipulating it: $app = New-Object -ComObject "Excel.Application" However, if I need to use the constants like xlDoubleQuote or xlDelimited - it seems like I am forced to hard code them. I would really like to be able to do something like: $constants = New-Object -ComObject "Excel.Constants" $constants.xlDoubleQuote And see that it would return the value of 1. Unfortunately I can't create

Cannot debug or run Word AddIn because the required version of Microsoft Office is not installed

你。 提交于 2019-11-29 22:51:09
I need to work on an existing Word 2007 addIn project that's a part of a MSVS 2008 solution. However, when I try to debug the addIn, I get the following error message: "You cannot debug or run this project, because the required version of the Microsoft Office application is not installed". I have Office 2007 installed. I tried creating a new Word 2007 addIn project in the same solution, and I have no problem debugging it. As far as I can tell, all the referenced Office assemblies are the same between these two projects. Referenced Office assemblies: Microsoft.Office.Interop.Word (c:\Program

How to develop a Microsoft Office AddIn without Visual Studio

十年热恋 提交于 2019-11-29 20:41:48
I'm trying to develop an MS Office Addin in C# .Net and I don't have access to Visual Studio. Instead I'm using SharpDevelop as my IDE, (but my question is equally relevant to anyone developing using any other IDE or compiling from the command line...) I've done a bit of searching for guides on how to develop AddIns, but they all seem to require Visual Studio and follow these steps: Install the Interop Assemblies Create a Visual Studio .Net Project ( I'm unable to do this bit ) Extend the VS ThisAddIn template What I've managed to do is to: Install the Interop Assemblies Create a C# empty

Using ElasticSearch and/or Solr as a datastore for MS Office and PDF documents

别等时光非礼了梦想. 提交于 2019-11-29 20:29:46
I'm currently designing a full text search system where users perform text queries against MS Office and PDF documents, and the result will return a list of documents that best match the query. The user will then be to select any document returned and view that document within MS Word, Excel, or a PDF viewer. Can I use ElasticSearch or Solr to import the raw binary documents (ie. .docx, .xlsx, .pdf files) into its "data store", and then export the document to the user's device on command for viewing. Previously, I used MongoDB 2.6.6 to import the raw files into GridFS and the extracted text

Get started with Office 365 REST API

南楼画角 提交于 2019-11-29 20:18:42
I'm sure related questions have been asked, but I cannot find this answer. I'm trying to make a simple ruby api wrapper for Office 365, and I can't figure out how to get an oauth app created (secret/token/callback url/. In everyone else's oauth/api universe you head to a developer portal and create an 'Application' which comes with a token and secret to use with your generic oauth library to do the 3 legged browser based authentication. I am not going to touch any windows/.net software to accomplish this - we are in ruby land. I think based on the documentation I need to head to the windows