ms-word

vba When inserting file, margins in new section disappearing

泄露秘密 提交于 2020-01-06 07:04:09
问题 I want to insert DocB' into DocA using the VBA code: Selection.InsertFile DocB. DocA is a normal document in every regard. DocB has 2 sections. The first is 'normal' stuff. The second section (properly marked with a Section Break/Next Page) has a new set of left and right margins. When DocB is inserted into DocA with the above VBA command, all formatting (fonts, spacing, etc.) EXCEPT that the margins in the second section of DocB don't carry into DocA. (The Section Break/New Page marker is

How to set MS Word page size via the automation API?

安稳与你 提交于 2020-01-06 06:42:08
问题 I need to change MS Word document's page size from Letter to A4 and found this automation class: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document_members.aspx. Which property (possibly a nested one) do I need to set? I can't find anything related to page size. 回答1: Based on the documentation you reference it is seen that a Document exposes a PageSetup property. The PageSetup property has a PaperSize property which allow you to define the paper size of the

How to set MS Word page size via the automation API?

亡梦爱人 提交于 2020-01-06 06:42:04
问题 I need to change MS Word document's page size from Letter to A4 and found this automation class: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document_members.aspx. Which property (possibly a nested one) do I need to set? I can't find anything related to page size. 回答1: Based on the documentation you reference it is seen that a Document exposes a PageSetup property. The PageSetup property has a PaperSize property which allow you to define the paper size of the

Is it possible to add Repeating Section Content Control section with VBA?

感情迁移 提交于 2020-01-06 06:18:12
问题 I have created Word template with Repeating Section Rontent Control (RSCC) containing other Content Controls . Also I have excel workbook with information which should go to mentioned Word template. The thing I am trying to do is to create macro which would fill Word template with information from selected rows in Excel workbook (each row to new RSCC section). I have quite good idea how to do that, except one thing- I cannot figure out how to write macro which would add another section to

Word JS APIs: extending a Range

亡梦爱人 提交于 2020-01-06 05:52:08
问题 While working on answering this question I would really like to have been able to extend a Range by a specific number of characters. In the COM API I would have used Range.MoveEnd() . Is there any equivalent that I didn't find in the JS API? Background: The question referenced is about finding search terms with more than 255 characters - which is a limit in Word for the desktop. The search fails. The simple way to go about it would be to search the first 254 characters, then expand the found

C# Microsoft.Office.Interop.Word

ぐ巨炮叔叔 提交于 2020-01-06 05:45:08
问题 I'm using Microsoft.Office.Interop.Word with C#. I know that you can set the text to be bold by using Range.Font.Bold=1. My problem is that I have a long sentence and I have to make some words bold in it, not the whole sentence. If my sentence is "Would you like to have responses to your questions sent to you via email?", I would like "have responses" to be bold. With this example I can bold only one word (by looping through the whole word document): foreach(Microsoft.Office.Interop.Word

MS Word documents to RTF documents

杀马特。学长 韩版系。学妹 提交于 2020-01-06 05:27:17
问题 I've a problem: my application must convert ms word documents (imported from another system) into rtf documents, in order to be manipulated with OOo APIs and to be immune from mistakes (for coding incompatibility reasons). I ask you: how can I manipulate ms word documents directly from my Java application? There are APIs (like POI or OOo) that allow me to do my work without any coding incompatibility? My system runs on Linux server machines (such as all production systems for public) and I've

“No add-ins currently available.” when deploying add-in using Centralized Deployment

大憨熊 提交于 2020-01-06 04:33:28
问题 I am trying to deploy an add-in with add-in commands on the desktop version of office 365, using the Centralized Deployment method. I followed the instructions for Centralized Deployment and the addin appears as "on" in the Office 365 admin center. I used both "Everyone" and "Specific User/Group", but when I open the Word application and go to Add-ins, under "Admin Managed" I see no addins , and the message "No add-ins currently available." The addin is'nt visible neither on Word 2016 Desktop

How to create nested fields using C# Interop.Word (IF option with MailMerge Fields)

此生再无相见时 提交于 2020-01-06 04:11:22
问题 I am trying to set MailMerge fields and let Word fill them for me, which isn't a Problem at all... What i am looking to do and can't figure out is the following, I want to set 2 MailMergeFields in 1 place and let Word sort it out for me. In this case have a mergefield for PO_Box and Adress, if there is a PO_Box # use it, otherwise use the Standard Adress. Example of the MailMerge what it would look like in Word: { IF { MERGEFIELD PO_Box } > "1" "{ MERGEFIELD PO_Box }" "{ MERGEFIELD Adress }"

Change selected automatic numbered list to plain text in word

妖精的绣舞 提交于 2020-01-06 03:52:07
问题 I need to create a macro that will convert some automatically numbered lists to plain text. I found this macro below which will do the whole document perfectly, however I wish to keep the document titles etc still numbered automatically and just change the numbered list of requirements in the document to plain text. Sub Auto_Format_convert_list_numbers() ' ' convert_list_numbers Macro ' Macro created 10/8/08 by WJ Shack ' ActiveDocument.ConvertNumbersToText End Sub My thoughts on the subject