ms-word

Insert table, bookmarks, and pages into middle of Word document

只谈情不闲聊 提交于 2020-04-17 23:40:15
问题 The following very helpful code from @macropod (at bottom) works well to insert tables/bookmarks/page breaks, generated in Excel, into the end of a Word document (How to insert table and bookmark into Word, one per page). I'm trying to modify the code to insert into the middle of an original 2 page document, with one table on one page and a second table on page 2, and a few empty paragraphs and a pagebreak in between. The result should be each new bookmark/table combo is iteratively inserted

How to retrieve data from Excel and add to Word

我怕爱的太早我们不能终老 提交于 2020-04-16 07:46:30
问题 I have a Word template file that retrieves data from an Excel file to populate a form. The code looks something like this: Dim myXL As Object Set myXL = Getobject("myfile.xls") myXL.Application.Visible = True myXL.Parent.Windows(1).Visible = True This code works fine in Office 2010 and 2007, but when I try it in 2013, it gives run time error 9 which is an array subscript error . When I check the Windows array it has zero elements, so error is correct. How do I achieve the same result in 2013?

How to retrieve data from Excel and add to Word

喜欢而已 提交于 2020-04-16 07:46:12
问题 I have a Word template file that retrieves data from an Excel file to populate a form. The code looks something like this: Dim myXL As Object Set myXL = Getobject("myfile.xls") myXL.Application.Visible = True myXL.Parent.Windows(1).Visible = True This code works fine in Office 2010 and 2007, but when I try it in 2013, it gives run time error 9 which is an array subscript error . When I check the Windows array it has zero elements, so error is correct. How do I achieve the same result in 2013?

Apache POI numbered list

自作多情 提交于 2020-04-13 18:34:04
问题 I am using apache-poi to write some data in a MS Word document. I've already spent several hours trying to figure out how to create a numbered list but I haven't achieved any results. I've gone through this, that and multiple other questions. Taking into account that apache-poi has the worst kind of documentation I've ever seen (basically there's no documentation at all) and their classes and methods have absolutely mad names it's too difficult for me to understand such complex examples. Q:

Auto creating tables in Word from an Excel document

僤鯓⒐⒋嵵緔 提交于 2020-04-12 20:41:53
问题 I have a set of data in Excel which is like the below (in CSV format) heading1, heading2, heading3, index A , randomdata1, randomdata2, 1 A , randomdata1, randomdata2, 2 A , randomdata1, randomdata2, 3 B , randomdata1, randomdata2, 4 C , randomdata1, randomdata2, 5 I want to be able to auto build a word document that presents this data, which the information grouped by heading1, into separate tables. So the word document would be like Table A heading1, heading2, heading3, index A ,

Auto creating tables in Word from an Excel document

纵饮孤独 提交于 2020-04-12 20:41:25
问题 I have a set of data in Excel which is like the below (in CSV format) heading1, heading2, heading3, index A , randomdata1, randomdata2, 1 A , randomdata1, randomdata2, 2 A , randomdata1, randomdata2, 3 B , randomdata1, randomdata2, 4 C , randomdata1, randomdata2, 5 I want to be able to auto build a word document that presents this data, which the information grouped by heading1, into separate tables. So the word document would be like Table A heading1, heading2, heading3, index A ,

Interop Word & Excel : Can't close an Excel workbook embedded in Word document

时光毁灭记忆、已成空白 提交于 2020-04-12 04:06:34
问题 I got an error when i'm closing the Excel workbook embedded in a Word document. This document got only one Excel chart. Nothing else : texts, etc... This is the code : Application _application = new Application { Visible = false, }; object oFilename = fileName; object oFormat = WdOpenFormat.wdOpenFormatXMLDocument; _document = _application.Documents.Open( ref oFilename, ref _missing, ref _faux, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref oFormat,

Interop Word & Excel : Can't close an Excel workbook embedded in Word document

▼魔方 西西 提交于 2020-04-12 04:06:06
问题 I got an error when i'm closing the Excel workbook embedded in a Word document. This document got only one Excel chart. Nothing else : texts, etc... This is the code : Application _application = new Application { Visible = false, }; object oFilename = fileName; object oFormat = WdOpenFormat.wdOpenFormatXMLDocument; _document = _application.Documents.Open( ref oFilename, ref _missing, ref _faux, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref _missing, ref oFormat,

Using Excel data to create Word Doc caption labels in VBA

≡放荡痞女 提交于 2020-03-26 03:04:11
问题 I am trying to link a Word document report to an Excel database with VBA. I inserted various ActiveX text box controls in my document. I am manually entering each one of these text boxes with unique code ("Code"). The other text box controls will automatically populate based on the associated data in the Excel database. The matching factor will be the "Code". When I run the following code, I receive a Run Time Error 13 "Type Mismatch" on Row 16 ( If cell.Value... ). I don't have a lot of

Accessing a Word(.docx) file's content with Microsoft Graph REST API?

余生长醉 提交于 2020-03-25 18:39:18
问题 Is there a way to obtain the content of a Word document stored in the cloud through the Microsoft Graph API without having to download the file locally? The goal is to build an app that analyzes a Word document's inner content and produce some interesting data from it. However after searching through Microsoft's Dev Center, Graph Explorer, and their API's documentation repository, I can't find any API endpoints that can serve me that data. I can find some endpoints that deal with manipulating