ms-word

Export discontinuous range of pages to PDF

喜你入骨 提交于 2020-01-15 10:17:12
问题 I am trying to save a Word template in .pdf format. I need to print the following range (1-3,18). The problem is that using "ExportAsFixedFormat2" does not allow me to select that range or at least I dont know how: wdapp.ActiveDocument.ExportAsFixedFormat2 OutputFileName:=savenamepdf, ExportFormat:=wdExportFormatPDF, Range:=wdExportFromTo, From:=1, To:=3 If I use "printout" I can select the range and create the pdf file, but when I try to open it I get an error message like it is broken or

Embed Word document preview in WinForms app

爱⌒轻易说出口 提交于 2020-01-15 09:05:12
问题 How can I embed a word document in a form or usercontrol like the explorer preview panel does? I found this topic and they say DSOFramer isn't available any more, but what should I use now? A third party tool is only acceptable if its free. The only thing I noticed was that prevhost.exe starts a winword.exe process with the -Embedding command switch, but I can't find any information on this switch. 回答1: Okay I found the solution, it was kinda obvious. I created a UserControl which accesses

Embed Word document preview in WinForms app

寵の児 提交于 2020-01-15 09:04:49
问题 How can I embed a word document in a form or usercontrol like the explorer preview panel does? I found this topic and they say DSOFramer isn't available any more, but what should I use now? A third party tool is only acceptable if its free. The only thing I noticed was that prevhost.exe starts a winword.exe process with the -Embedding command switch, but I can't find any information on this switch. 回答1: Okay I found the solution, it was kinda obvious. I created a UserControl which accesses

Using python win32com can't make two separate tables in MS Word 2007

徘徊边缘 提交于 2020-01-15 06:52:06
问题 I am trying to create multiple tables in a new Microsoft Word document using Python. I can create the first table okay. But I think I have the COM Range object configured wrong. It is not pointing to the end. The first table is put before "Hello I am a text!", the second table is put inside the first table's first cell. I thought that returning a Range from wordapp will return the full range, then collapse it using wdCollapseStart Enum which I think is 1. (I can't find the constants in Python

Getting Range coordinates only for Ranges on the screen

泪湿孤枕 提交于 2020-01-15 06:51:06
问题 I am currently using the following method to find the coordinates of a Range within a document: private Rectangle GetRangeCoordinates(Window w, Range r) { int left = 0; int top = 0; int width = 0; int height = 0; w.GetPoint(out left, out top, out width, out height, r); return new Rectangle(left, top, width, height); } This works really well unless the Range is off the screen by a fairly large margin (quite a few pages), in which case I get the following exception: System.Runtime

Converting byte array output into Blob corrupts file

元气小坏坏 提交于 2020-01-15 06:35:49
问题 I am using the Office Javascript API to write an Add-in for Word using Angular. I want to retrieve the Word document through the API, then convert it to a file and upload it via POST to a server. The code I am using is nearly identical to the documentation code that Microsoft provides for this use case: https://dev.office.com/reference/add-ins/shared/document.getfileasync#example---get-a-document-in-office-open-xml-compressed-format The server endpoint requires uploads to be POSTed through a

Converting byte array output into Blob corrupts file

拈花ヽ惹草 提交于 2020-01-15 06:35:12
问题 I am using the Office Javascript API to write an Add-in for Word using Angular. I want to retrieve the Word document through the API, then convert it to a file and upload it via POST to a server. The code I am using is nearly identical to the documentation code that Microsoft provides for this use case: https://dev.office.com/reference/add-ins/shared/document.getfileasync#example---get-a-document-in-office-open-xml-compressed-format The server endpoint requires uploads to be POSTed through a

VBA 6 : regex not recognizing complicated string

ⅰ亾dé卋堺 提交于 2020-01-15 06:07:21
问题 I have this string "1X214X942,0SX" where each X represents a "non-breaking space" (a whitespace to be exact) with the ASCII code 160, and S represents a space character. I am trying to recognize it with this regex: (\d{1,3}\s(\d{3}\s)*\d{3}(\,\d{1,3})?|\d{1,3}\,\d{1,3}) but it doesn't work, as this whitespace is not recognized and the expression only catches 942,0 . I have tried to see if RegExr can catch the whole string and it can, ( http://gskinner.com/RegExr/?2v8ic) so there's something

Word 2007 Add-in Task Pane doesn't work in one specific case

孤街醉人 提交于 2020-01-15 03:56:07
问题 I am just starting out with a Word VSTO Add-in. I want to add a group to the ribbon, which has a button to toggle a custom task pane. I want each document to have it's own independent task pane. I have this mostly working, but there is one situation that doesn't work: Start Word - new document opened, all works fine Open existing document (closes empty document) Click on toggle button, pane doesn't appear Create new document or open ANOTHER existing document, pane appears on that document

Index Word/PDF Documents From File System To SQL Server

萝らか妹 提交于 2020-01-14 10:12:20
问题 I'm trying to come up with a simple solution to a problem I have because all of those I have found so far just seem too complicated! The situation is that we use a proprietary application for managing most aspects of our business. It has an SQL Server 2005 backend database, which is quite large. The application also allows the attaching of Word and PDF documents to records, which we use extensively, and these are stored in the file system on the server, with the filenames referenced in the