ms-word

Close MS Office C# Console

强颜欢笑 提交于 2019-12-25 01:48:43
问题 I'm writing an automated test to determine whether or not rtf files are successfully opened by MS Word. So far I looping through all the rtfs within a given directory and opening them. Later I will have to catch exceptions to generate a report (log the file name that crashed word). I am processing a large number of files. My application is currently opening a new instance of Word for each file. Can someone tell me how to close Word? public class LoadRTFDoc { private object FileName; private

Can I export Word document(*.doc) from Reporting Service by using free component? [closed]

落花浮王杯 提交于 2019-12-25 01:35:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for some tool that can generate many document formats like Microsoft Excel, PDF, Microsoft Word, HTML. So, I decide to use Reporting Service of SQL Server 2008 Express. But I found that Reporting Service can't export to Microsoft Word by itself. It need to use some component. Moreover, I can't find

Find and replace multiple words in Word

随声附和 提交于 2019-12-25 01:18:44
问题 I really hope you guys can help, I feel like I've been struggling with what should be (and probably is) a really simple problem. I've written an app which creates a folder structure, copies in the relevant test documents based on user inputs, and populates the document header and test sheets with various variables. I have populated the template test documents with placeholders, ("replCustNo","replPrjNo","replCustRef" etc), some in the header, some in the body of the document. I can only seem

The word document cannot be opened after adding excel charts to it using OpenXml

会有一股神秘感。 提交于 2019-12-25 01:14:20
问题 I tried to append excel charts to a word document using OpenXml. But after that when I'm trying to open the document it says "Sorry we can't open the file.docx because we found a problem with its contents" This is my code public void excelToImages(string excelSource, string wordSource) {using (SpreadsheetDocument document = SpreadsheetDocument.Open(excelSource, true)) { WorkbookPart workbookPart = document.WorkbookPart; string relId = workbookPart.Workbook.Descendants<Sheet>().First(s =>

How to get around the character limit on FormFields VBA passing from Access to Word

老子叫甜甜 提交于 2019-12-25 01:11:55
问题 I'm attempting to pass the content of fields in an Access form to a Word document, which, using the below code, does exactly what I need it to, except for one small issue with one of the fields. .FormFields("txtReasonforReward").Result = Me![Reason for Reward] is giving me some issues as I am hitting the character limit. I've seen several examples on how to circumvent this, but I'm not sure how they work within my base code. I'm feeling a little inadequate in my understanding of VBA at the

Creating a dynamic list number in MS word using VBA

这一生的挚爱 提交于 2019-12-25 01:06:54
问题 I wonder how can I insert dynamic multilevel list numbers. The client request applying his Word 2010 template a "Point Headings" - similar to Point Pages behavior. Meaning: Assuming the following Heading formats: Heading 2 - 1.1 Heading 3 - 1.1.1 Heading 4 - 1.1.1.1 Heading 5 - 1.1.1.1.1 The purpose is to keep existent numbering and add in between numbered list. For example: Between two Heading 3 style headers 1.3.5 and 1.3.6 will come 1.3.5.A followed by 1.3.5.B and so on. obviously a

How do I get a python dictionary into a document merge as kwargs with docx-mailmerge

痞子三分冷 提交于 2019-12-25 01:06:27
问题 So I've got this dictionary mydict = {'name': 'Theo', 'age': '39', 'gender': 'male', 'eyecolor': 'brown'} and I use docx-mailmerge to merge this data into a word document. template = "myworddoc.docx" newdoc = "mergeddoc.docx" document = MailMerge(template) document.merge(mydict) document.write(newdoc) But the document created is empty. I guess it only works with kwargs?? Can I only use the merge with kwargs so document.merge(name='Theo', age='39', gender='male', eyecolor='brown') I really

Unable to run macros in dotm files on other PCs

故事扮演 提交于 2019-12-25 00:53:20
问题 Macros created and updated to .dotm files work well on the creator's PC, but when distributed to other users they do not work (run). Tried and double-checked the Trust center settings on MS Word: Macro setting is 'Enable all macros'. Ensured that the location the ("%appdata%\Microsoft\Word\Startup") is already a Trusted Location. Ensured that all the check points mentioned in this link are as expected. The code is created following this tutorial: While the VBA add-in gets recognized, when I

Apache POI - Generated Word document works but invokes a security warning

自闭症网瘾萝莉.ら 提交于 2019-12-25 00:30:24
问题 I'm using Apache POI in a Java project to generate a word document based on a template. Specifically I'm using the HWPFDocument class and both the template and the output file is in the old .doc format (Word 97-2004). The reason why I'm using the old format is that I couldn't find any examples on how to search/replace placeholders in a template with the new .docx format. The code works just fine and I have no problem opening the generated .doc file on my Mac (Word 2011). But on Windows

Get PID of COM server

末鹿安然 提交于 2019-12-25 00:22:34
问题 I create a com object in powershell like so: $application = new-object -ComObject "word.application" Is there a way to get the PID (or some other unique identifier) of the launched MS Word instance? I want to check if the program is blocked e.g. by modal dialogs asking for passwords, and I can't do it from whithin PowerShell. 回答1: Ok, I found out how to do it, we need to call the Windows API. The trick is to get the HWND, which is exposed in Excel and Powerpoint, but not in Word. The only way