ms-word

New line formatting when using HTML file as Word file?

浪尽此生 提交于 2019-12-24 12:34:55
问题 I'm writing a PHP application for a client that needs a pre-existing HTML page I've already created to be "exported" as an Word file. Simply, this is how it's done: if (isset($_GET["word"])) { header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=some_file.doc"); } This, of course, will be called if a "word" flag is located in the page querystring, e.g.: whateverpage.php?somequery=string&someother=test& word Anyways, my question is, despite how

Microsoft.Office.Interop.Word.Document won't prompt to save changes to single document without _Application.Quit()

六眼飞鱼酱① 提交于 2019-12-24 12:28:01
问题 Before I begin, I have googled this to death and there are many posts about how to prevent the save prompt. I am having an issue showing the save prompt. I am building the template editing portion of a document generation system in C#. The system will edit 'dot' and 'dotx' files. Before outlining the problem, the environment I am using for development is running Visual Studio 2010 and Word 2010. It will eventually run on other versions, but i would like to get these versions functional first.

How to sort an array of strings containing numbers

五迷三道 提交于 2019-12-24 12:14:17
问题 I'm having some trouble correctly sorting an array numerically based on strings that contain numbers: So, the sort works for all strings up until I get into 2 digit numbers. For example, if the array contains "Issue 2:" "Issue 5:" and "Issue 3:" it correctly sorts the strings to be 2, 3, 5. Unfortunately, as soon as I get two digit numbers it no longer sorts correctly. So "Issue 10:" "Issue 8:" and "Issue 13:" will not sort. I'm fairly certain it has to do with the fact that I'm trying to

VBA extract and parse data from website to Word

为君一笑 提交于 2019-12-24 12:13:05
问题 I'm trying to extract some data from here: http://www.hnb.hr/tecajn/f140215.dat This is the exchange rate list from the Croatian National Bank. The file name "f140215.dat" is basically a date, formatted in the following order: "f" "DDMMYY" ".dat" I intend to have the data organized in a Word table, which contains the following cells: Cell#1 where a user would manually input a date in the following format: "MMM DD, YYYY" Cell#2 where a user would manually input the requested currency code name

Using AccessibleObjectFromWindow in python on Microsoft Word instance

我只是一个虾纸丫 提交于 2019-12-24 12:04:11
问题 I am trying to manipulate a particular already-open, unsaved (so no path) Word document (*.doc) with python. The manipulations work great if only one Word instance is open, however multiple instances create some difficulty, reference the SO question Word VBA and Multiple Word Instances. I have found some references on dealing with this in C# (How to access Microsoft Word existing instance using late binding) and VB.NET (Multiple Instances of Applications) and have managed to translate them to

How to search/find for multiple format styles in VBA for Word?

旧街凉风 提交于 2019-12-24 11:30:36
问题 Thanks in advance for taking the time to read this. I would like to code the Find function in Word 2013 for searching specific words in multiple styles. Not even sure if this is possible because Word doesn't have that option in Advanced Find --> More --> Format --> Style. It only allows for filtering one style. My goal is to be able to find paragraph marks (syntax: ^p) on styles 'Heading 1' through 'Heading 9'. Sub AppendixFix() ' Declaring variables Dim multiStyles As String, i As Integer

How to write unit test for class that writes data into word document with apache-poi java?

只愿长相守 提交于 2019-12-24 11:18:29
问题 I created a word-document with apache-poi (poi-ooxml version 3.15) and now I want to write unit tests for my classes. What is the best way to do that? We're using mockito(2.15.0) in our project. This is one of the classes I'm trying to write test for: @Component public class ProffesionalSumaryService { public void populateDocumentWithProfileSkills(XWPFDocument document, ExportProfileDTO profileData){ XWPFTable antet = document.createTable(); antet.getCTTbl().getTblPr().getTblBorders()

Using olefile to extract text from Word .doc

淺唱寂寞╮ 提交于 2019-12-24 11:12:09
问题 I am only concerned with getting the text from .doc files. I am using python 3.6 on windows 10, so textract/antiword are off the table. I looked at other references from this question but they are all old and incompatible with windows 10 and/or python 3.6. My document is a .doc file with a mix of Chinese and English. I am not familiar with how Word stores its files, and I don't have Word on my machine. Using olefile I was able to get the bytes of the document, but I do not know how to

C# Retrieve FormFields from Word Document and Insert into Text file

牧云@^-^@ 提交于 2019-12-24 10:50:47
问题 I'm trying to figure out how to iterate through a document and pull all form fields and insert them into a new text file. I'm working through it trying to find examples of the functions I'm going to need and I'm not coming up with a lot of information. Maybe I'm not searching properly though. Here's what I've written so far. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

Locked for editing when using VBScript on docx

落花浮王杯 提交于 2019-12-24 10:49:47
问题 I have a simple plan to read the header and text from a .docx Word file using VBScript. So far so good. However, if you make a mistake in your code it'll lock up the document you are working with: "test.docx is locked for editing" You get given the options of one of the following Open a Read Only copy Create a local copy and merge your changes later Receive notifications when the original copy is available After which when running the code again I get the error The requested member of the