ms-word

Word VBA: find line and replace font

时光毁灭记忆、已成空白 提交于 2021-02-10 14:23:09
问题 I've written a VBA Word Macro that read a .txt File, copy it and paste it in a Word document setting a new font. All is working fine! Now I would like to highlight some specific lines with bold + italic font, but i cannot figure out a working solution. The specific lines begins with a specific word (for example Simulation Nr.xxx ) or they begin with some words but then they have a very long series of blank spaces (for example Turbine ). How can i solve the problem? P.s.: here the working code

Inconsistent host behavior with Office JS insertHTML and paragraph formatting

淺唱寂寞╮ 提交于 2021-02-08 14:34:10
问题 I've noticed an inconsistency in office-js between Word 2016, Word for Mac and Word Online. When inserting a single <p> element with block/paragraph formatting, it seems that Word 2016 does not apply the paragraph formatting as defined in the style attribute of the <p> element. I can reproduce this both in the body of the document and in a Content Control. When I execute this snippet in an empty document on Word 2016 or Word for Mac: await Word.run(async (context) => { context.document.body

css print mode: display header and footer only on first page of a generated word doc

ε祈祈猫儿з 提交于 2021-02-08 14:10:32
问题 I'm successfully generating word documents using html code with header and footer styled in css print mode, here is my code : <html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'> <head><title>Mon document</title> <meta charset=\"UTF-8\" /> <!--[if gte mso 9]> <xml><w:WordDocument><w:View>Print</w:View><w:Zoom>100</w:Zoom><w:DoNotOptimizeForBrowser/></w:WordDocument></xml> <![endif]--> <link rel=File

Convert PDF to Word Doc using excel VBA code

两盒软妹~` 提交于 2021-02-08 12:16:45
问题 everyone. Im need a VBA code to convert excel data to PDf to word doc, i wrote a macro that prints out excel as a pdf but now i would like to print it out as word from that pdf, so short version, Excel to PDF to Word. all this do to i wanna keep the format of the excel data 回答1: This will do what you want, but you need Adobe Acrobat installed. I don't know of any way to do this without having Acrobat installed. Option Explicit Option Private Module Sub ClearPaths() '--------------------------

Convert PDF to Word Doc using excel VBA code

只谈情不闲聊 提交于 2021-02-08 12:16:33
问题 everyone. Im need a VBA code to convert excel data to PDf to word doc, i wrote a macro that prints out excel as a pdf but now i would like to print it out as word from that pdf, so short version, Excel to PDF to Word. all this do to i wanna keep the format of the excel data 回答1: This will do what you want, but you need Adobe Acrobat installed. I don't know of any way to do this without having Acrobat installed. Option Explicit Option Private Module Sub ClearPaths() '--------------------------

How to resolve runtime errors copying from excel to word

送分小仙女□ 提交于 2021-02-08 11:28:33
问题 I am currently working on an excel Userform to generate a report for a lot entered on a given day. The report is stored in a separate word document which contains the results of between 1 and 8 quality samples (number of samples varies by lot). The Userform is meant to load in excel, receive a lot number and date from the user, retrieve samples from that day and lot from a different sheet in the excel workbook and then copy the data into a new word doc based on a custom template. I have

Saving Word document as PDF

天涯浪子 提交于 2021-02-08 10:35:56
问题 This is related to converting a Word document to PDF format. I get an error in my Excel VBA code. Run-time error "5": Invalid procedure call or argument Saving into a Word document works objWord.ActiveDocument.SaveAs PathName & NewFileName & ".docx" The below runs but it creates a PDF document which is very big in size. objWord.ActiveDocument.SaveAs2 Filename:=PathName & NewFileName & ".pdf", _ FileFormat:=wdFormatPDF I recorded a macro in Word to save the file as PDF and modified the

DOCX to PDF: SaveAs2 vs ExportAsFixedFormat vs PrintOut

て烟熏妆下的殇ゞ 提交于 2021-02-08 10:23:22
问题 I have the tiny goal to convert a huge load of docx files to pdfs using C# and .NET without opening Word (visibly) and without using any third party library (less components to manage and less money to spend). At the moment, I am trying to correctly convert a single document, which has to be as efficient as possible in order to quickly convert the huge load mentioned before (several thousand docx files, each between 100 and 300 kb). I am using Word = Microsoft.Office.Interop.Word; and I am

How to merge entirely different pages based on value of merge field

ε祈祈猫儿з 提交于 2021-02-08 09:37:11
问题 At my office we use documents with merge fields from Microsoft Word for a number of different functions. However, I can't find a way to merge entire pages based on the value of a merge field. For instance, there are different forms you have to use to notarize documents in different state. I want to set it up so that if the state chosen is MN, the document will generate the notary form for Minnesota, if the state chosen is NC, the document will generate the notary form for NC, etc. Is this

Get byte Array from current opened downloaded Word Document .docm from Sharepoint, without save to local drive

时光毁灭记忆、已成空白 提交于 2021-02-08 06:47:49
问题 How can I get the byte array of the opened Word Document (.docm) without saving it to a local drive first. The document will be opened on a Thin Client without any local drive from SharePoint. When the user want to save the changes, I need to send the byte array to a web-service to process it. (Not back to SharePoint). Dim filePath As String Dim fileName As String Dim fullFileName As String filePath = ThisDocument.path fileName = ThisDocument.Name fullFileName = filePath + "/" + fileName the