ms-word

Multi-dimensional array in VBA for Microsoft Word on Mac

夙愿已清 提交于 2019-12-25 03:33:00
问题 I'm working on a macro to loop through a series of strings ( a1, a2, a3 ) and replace them with a series of corresponding values ( b1, b2, b3 ). I've created an array to store the strings to match: Dim search_strings(1 To 2) As String search_strings(1) = "match1" search_strings(2) = "match2" I can loop through this array with a For Each loop. But I can't figure out how to store and reference the corresponding replacement text. I know that I need some sort of key/value pair. I've tried using a

MS Word VBA search text with find wildcards

百般思念 提交于 2019-12-25 03:28:36
问题 I need find these matches using "ms word find" with wildcards: {{1,000.00}} {{-125}} {{125-}} {{-1’100.00}} {{1’100.00-}} What should be the Selection.Find.Text for it? I tried this: [\{]{2}<*>[\}]{2} but it does not work for some words. This wildcard works almost exactly to what I need. I modified a bit to exclude Paragraph return ^13 [\{]{2}[!\}][!^13]@[\}]{2} However I have a problem matching a paragraph like this blabla {{2}} {{-2-}} blabla in this case it matches the whole paragraph ( {

Replacing Word's Open File Dialog in a COM Add-in

拈花ヽ惹草 提交于 2019-12-25 03:22:08
问题 I'm writing a Word COM Add-in that replaces the Open & Save dialogs with my own. For the save dialog, I'm handling the documentBeforeSave event from the application events. This works fine. For the open dialog, there is no such event, so I'm currently handling the onClick of the Open... menu item, canceling the default handling. This works ok if the user indeed uses this menu item, but if the user presses CTRL-O in stead they still get the original dialog. Is there a better way to hook into

body.search Issue in word desktop

岁酱吖の 提交于 2019-12-25 03:14:11
问题 context.document.body.search() is throwing an InvalidArgument exception in Word 2016 for desktops when the text to search for is larger than 255 characters. The same seems to be working with Word Online. var searchResults = context.document.body.search("TextMoreThan255Chars"); context.load(searchResults); return context.sync().then(function() { }); 回答1: What you're experiencing is a limitation in Word (for the desktop). Some more information is available on Greg Maxey's site, for example. The

open word doc with c#

风流意气都作罢 提交于 2019-12-25 02:54:00
问题 Im using some code I found to open word docs from a webpage using c#. I have added the docs to the project as existing items, im just wondering the besy way to refer to them in the code, eg object filename = "f:\\Online_signup1\\DONE-Signup_Step1.dot"; or just object filename = "DONE-Signup_Step1.dot"; thanks again 回答1: I'd put them all in a "Resources" folder or similar inside your project, add a Project Settings file ("app.config") which has the name of that folder, and then refer to them

Calling AppActivate on a word 2007 window in Windows 7 gives it focus but doesn't bring it to top of stack

半腔热情 提交于 2019-12-25 02:25:44
问题 I'm trying to manipulate Word from an HTA file application. Currently, when I open word, it opens underneath my application. I'd like to open it on top. I've tried using the following JScript to give Word the focus: wshShell = new ActiveXObject("WScript.Shell"); wshShell.AppActivate(doc.windows.Item(1).caption); This works, and word gets focus, but on Windows 7 it stays underneath my app. Is there something else I need to do to bring word to the top? 回答1: If you can't force that window to the

Disable Word Online platform when publishing office js application to store

天涯浪子 提交于 2019-12-25 02:16:11
问题 Is it possible to publish office js Word plugin for Word 2016+ but not for Word Online platform? 回答1: All apps and add-ins submitted to the Office Store must comply with the Office Store Validation Policies Specifically section 4.12.1, "Your add-in must work across all platforms that support the methods that you define in the Requirements element in your add-in manifest." For details about which platforms support which methods, see Office Add-in host and platform availability. 来源: https:/

Pull data from Access database to Word document

雨燕双飞 提交于 2019-12-25 01:55:21
问题 I am attempting to transfer data from an Access database into a Word document. I have performed a similar procedure using Excel and I need to code it using Access instead of Excel. The Excel code (for an analogy is this) Dim myworkbook As Excel.Workbook Set myworkbook = GetObject("C:\Users\jn\Desktop\trial.xlsm") then Dim excelstr As String Excelstr = Application.Range("A1:A100").Find("aword").Offset(0,1).Value I can't figure out how to do this with Access where I pull in data by finding a

ms word 2010 with aspx

喜你入骨 提交于 2019-12-25 01:55:15
问题 I want to display a Word 2010 document inside of an aspx page. The user will select some word ranges and the position of this selection will need to be sent server side. Conversion, displaying rtf or any other solution will not work because they need the input to be the same as html to display. Is there is any alternate option for my problem? 回答1: I want to display word 2010 inside an aspx page. That's simply not possible. If conversion of the documents isn't an option, then you need to

Add specific Document to specific Word.Application

浪尽此生 提交于 2019-12-25 01:54:14
问题 May I assign the objDoc as a document of the ObjWord (after Set objDoc = oDoc.Object )? My code looks like this: 'Declaration Dim oDoc As OLEObject Dim objWord As Word.Application Dim objDoc As Word.Document Dim WS as Worksheet Dim strOdoc as String 'Initialization Set WS = Whorksheets("Sheet1") strOdoc = "WordDoc" Set objWord = New Word.Application 'Set objWord = GetObject(, "Word.Application") 'I need using GetObject to be able to made the activated OLEDocument, invisible. 'And Need Set