ms-word

Programmatically insert image to word with link to file

夙愿已清 提交于 2020-01-25 12:49:48
问题 In Word document, there is an option in the insert image dialog box insert button that is "Link to File", where I can input a image url link into the file name input box. Word will then pull that image from the link. As such everytime the user opens the word document, it will pull that image from the link. How do i do that with Microsoft Interop? Ive tried to use this method http://www.c-sharpcorner.com/uploadfile/hrojasara/insert-picture-with-hyperlink-in-word-file-using-C-Sharp/ However it

Word macro behaves different on macOS

爱⌒轻易说出口 提交于 2020-01-25 10:19:06
问题 I've written a small programm in MS Word VBA that is working perfectly fine for all windows machines I've deployed it to. However the computers running macOS seem to have trouble with it. In a collection I always store an array as value and give it a unique key. These arrays always contain a sequence (like 'a\') at index 0 and up to 5 combining diacritical marks. These diacritical marks, such as the accent grave (on the à for example), are stored via their numerical value, in this case '0300'

Copy from Excel Workbook to Document from Word without Adding Reference

牧云@^-^@ 提交于 2020-01-25 08:07:05
问题 I'm looking to create a spell check macro for protected word documents. I'm more familiar with Excel VBA and I just created a similar project for protected spreadsheets so I attempted to follow the same logic. So far my code copies misspelled words from the office document, into a new excel workbook and then runs spellcheck, but I am having trouble pasting the new value back into the original word document. I can't have this require "adding a reference library" as this will need to be

Prevent Save As Functionality

主宰稳场 提交于 2020-01-25 08:00:06
问题 I need to prevent a document from being saved / saved as (say from ms word). I've looked around and I havn't quite found a satifying answer. I've considered EFS... but I don't think it prevents the user from saving the document as... (though it prevents access to the original source file). Any ideas outthere? 回答1: Run it on completely locked-down system with read-only disk, no network and no removable drives. Access to the computer must be phisically restricted as well. This should prevent

highlight current line of word document when move up or down

不想你离开。 提交于 2020-01-25 06:16:39
问题 I wanted to develop a program such a way that when up or down arrow moved, highlight the entire line of text. So when I go up or down with arrow keys it highlight the line where my cursor is. So I developed this code. Application.ScreenUpdating = False Dim currentPosition As Range Set currentPosition = Selection.Range 'pick up current cursor position Selection.WholeStory Selection.Range.HighlightColorIndex = wdNoHighlight currentPosition.Select 'return cursor to original position Selection

How to print the sorted array in word using VBA?

柔情痞子 提交于 2020-01-25 00:59:07
问题 I have a two Input data of Year and Name in separate two arrays. I need to sort both the array values first i need to sort it chronologically(Year) and then if year information repeats it will sort the Array Alphabetically. As for as I complete the sorting for both year and then name. Using Wordbasic.sortarray command Input : (Before sorting) SDF 1997 ELS 1986 PJK 1983 WKL 1995 EFD 1986 Output : (After sorting) PJK 1983 EFD 1986 ELS 1986 WKL 1995 SDF 1997 If I print it in word it printed like

How to get Document Content Created Date using c#

夙愿已清 提交于 2020-01-25 00:29:05
问题 I'm creating a MS Word addin and would like to know how I can get the Content Created Date of the Active Document. This field can be found by going to the Properties of the Document, and then in the Details tab. See my code below so far. However, this is returning the an incorrect date value of "1/01/1601 11:00:00 AM". The actual Content Created Date is "05/09/2015 11:53AM" string docName = Globals.ThisAddIn.Application.ActiveDocument.Name; string res = Path.GetFileNameWithoutExtension

Export docx/doc First Header and Footer as docx File Using openXML

坚强是说给别人听的谎言 提交于 2020-01-24 21:27:28
问题 I want to ask how can i convert Header/Footer part of MS Word Document (doc/docx) to HTML. I'm opening the Document like: using (WordprocessingDocument wDoc = WordprocessingDocument.Open(memoryStream, true)) a.k.a OpenXML I'm converting the Document with WmlToHtmlConverter which converts the document excellent except that the headers and footers are skipt, cuz html standart doesnt support pagination. I was wondering how can i get them and extract them as html. I'm trying by getting them like

Add image using WordML

故事扮演 提交于 2020-01-24 20:58:27
问题 I am trying to add an image into a document using WordML. I have used the xml as a basis from the jpg example from here http://www.codeproject.com/KB/office/WordML.aspx. I have managed to write Java which creates this exact xml(wordML) in the document, however when I try and open the generated file in MS Word 2007 it says the file in invalid or corrupt. The xml for the document that won't open is here: http://pastebin.com/RNEkbvYG (Raw xml) Sorry for the long paste, this is the shortest

Add image using WordML

纵然是瞬间 提交于 2020-01-24 20:58:05
问题 I am trying to add an image into a document using WordML. I have used the xml as a basis from the jpg example from here http://www.codeproject.com/KB/office/WordML.aspx. I have managed to write Java which creates this exact xml(wordML) in the document, however when I try and open the generated file in MS Word 2007 it says the file in invalid or corrupt. The xml for the document that won't open is here: http://pastebin.com/RNEkbvYG (Raw xml) Sorry for the long paste, this is the shortest