ms-word

How to run a VBA Macro by clicking Word 2010 Checkbox?

送分小仙女□ 提交于 2020-01-14 09:17:28
问题 I want to run a macro when I click a checkbox in Word 2010 . Note that I neither want the "Legacy Forms" checkbox nor the "ActiveX" ones! They do only work in some "protected document mode" and look ugly, but I want the new ones which can be selected and unselected just when you write the document, and which look much nicer to me. I know, with the legacy forms, you can directly insert a Macro when entering the form element and one for leaving it, and you can catch the event in VBA like Sub

How to run a VBA Macro by clicking Word 2010 Checkbox?

╄→гoц情女王★ 提交于 2020-01-14 09:17:09
问题 I want to run a macro when I click a checkbox in Word 2010 . Note that I neither want the "Legacy Forms" checkbox nor the "ActiveX" ones! They do only work in some "protected document mode" and look ugly, but I want the new ones which can be selected and unselected just when you write the document, and which look much nicer to me. I know, with the legacy forms, you can directly insert a Macro when entering the form element and one for leaving it, and you can catch the event in VBA like Sub

Save a new Word Document for each row in Excel

ε祈祈猫儿з 提交于 2020-01-14 06:23:28
问题 I have an Excel file with a list of names as follows: *--------------------------------------* | Last, First Middle | email@site.edu | *--------------------------------------* All email addresses are "@site.edu" I have a Word file like this Dear <name>, ... Is there a way to automatically save a copy of the Word document with the name cell inserted over and save the file as "email" where "email" is the email address without site.edu? I would also like to change to be First Middle Last, but I

Interop - prevent a table wrapping over two pages in Word

一个人想着一个人 提交于 2020-01-14 05:06:05
问题 I am outputting multiple tables with a minimum of two lines of header information followed by 0 or several lines of data... My problem is that sometimes the tables wrap over the end of the page. How can I prevent this - is there a s property like doNotWrap' in MS Word tables? Here is the code I am using: // it's an Account list so what follows will be account data then transactions string[] sValues = pqRequests[s].Split('\t'); if (sValues[0]=="01") { iTable++; // output header info if

Filesystem Hook for .doc open C#

陌路散爱 提交于 2020-01-14 03:20:10
问题 I'm writing an application that needs to be notified of every doc file that is opened, I've tried using the FileSystemWatcher but it seems that these days NotifyFilter . LastAccess is disabled due to a large overhead. There is LastWrite which I suppose I could use but it would mean I'd need to try and figure out the original file name from the temporary file that word creates when it opens a document. I also need to keep watch on 4 directories so ideally I don't want to be polling them. I'm

how to detect merged cells in vba (Word 2010)

被刻印的时光 ゝ 提交于 2020-01-13 19:48:49
问题 I would like to detect and skip merged cells in vba on word 2010. I'm making a macro which need to write in the first column but I've some merged cells and I don't want to write in. All examples I found was for Excel. I tried to detect the number of columns per rows but that didn't works. I got "Error 5991 table has vertically merged cells" . So how can I just skip the row when I get merged cells ? Sub test() Dim Ro As Integer, Col As Integer 'init Count = 1 Col = 1 For Ro = 4 To

How to replace Numbers in Parentheses with some calculations in MS Word

非 Y 不嫁゛ 提交于 2020-01-13 19:24:10
问题 I have a problem to replace some serial number such as [30] [31] [32]... to [31] [32] [33]... in MS word when I insert a new references in the middle of article. I have not found a solution way in GUI so I try to use VBA to do that replacement. I find a similar problem in stack overflow: MS Word Macro to increment all numbers in word document However, this way is a bit inconvenient because it have to generate some replacement array in other place. Can I make that replacement with regex and

How can I loop through every letter in MS Word using VBA?

邮差的信 提交于 2020-01-13 11:37:07
问题 I have about 100 Word documents which include transliteration of foreign names. The author of these documents used a special font called e2 which has about a dozen special transliteration characters (all of which are available in Microsoft Sans Serif font). I would like to loop through every letter of the document and whenever the .Font = "e2" I would like to loop through the dozen letters (it's easy to guess what they are) and replace them with a Microsoft Sans Serif equivalent. But I can't

How to extract the contents of an OLE container?

佐手、 提交于 2020-01-13 10:45:12
问题 I need to break open a MS Word file (.doc) and extract its constituent files ('[1]CompObj', 'WordDocument' etc). Something like 7-zip can be used to do this manually but I need to do this programatically. I've gathered that a Word document is an OLE container (hence why 7-zip can be used to view its contents) but I can't work out how to (using C++): open the OLE container extract each constituent file and save it to disk I've found a couple of examples of OLE automation (eg here) but what I

How to extract the contents of an OLE container?

蹲街弑〆低调 提交于 2020-01-13 10:43:27
问题 I need to break open a MS Word file (.doc) and extract its constituent files ('[1]CompObj', 'WordDocument' etc). Something like 7-zip can be used to do this manually but I need to do this programatically. I've gathered that a Word document is an OLE container (hence why 7-zip can be used to view its contents) but I can't work out how to (using C++): open the OLE container extract each constituent file and save it to disk I've found a couple of examples of OLE automation (eg here) but what I