ms-word

How can I open Excel from another Office Application without setting references?

浪子不回头ぞ 提交于 2019-12-24 10:49:06
问题 From Word and Outlook, I'm trying to open open Excel using GetObject method but I need to set the references first. I receive "Compile error: User-defined type not defined". In order to manually fix this, I need to go to Tools>References>Microsoft Excel XX.X Object Library. Is there a way to not have to do the manual step of setting the reference? I access the same files from different sessions (local session, citrix, VM ware) that have different versions of Excel. https://docs.microsoft.com

MS Word Interop to C# - Inserting multiple files at a bookmark

风格不统一 提交于 2019-12-24 10:48:12
问题 I have one master document into which I want to insert a number of files. These should be inserted into the file one after another at a certain point in the middle of the document. So I have created a bookmark at this point called "TESTS", since this seems to be the easiest way of programatically finding the point. I am able to insert a single file using this code: Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word

How to bypass the 255 char limitation in MSWord Search&Replace using OLE

浪子不回头ぞ 提交于 2019-12-24 10:44:41
问题 I am using (in a Delphi win32 application) OLE to perform search and replace in Word Documents. THe user prepares a file with some textual tags enclosing them in "{" and "}" and saves the file. Something like Dear {NAME}, I want to tell you {WHAT_I_DID_LAST_WEEK} Of course NAME and WHAT_I_DID_LAST_WEEK are DB fields that can be longer than 255. So now by using Search and replace with OLE i get a STRING PARAMETER TOO LONG error (it seems 255 is the longest string usable there). Is there an

i want to create a VBA code in Word that will create multiple word files with different file names

丶灬走出姿态 提交于 2019-12-24 10:39:49
问题 I want to create multiple saves of the same word file using visual basic. each file will need to be named with the day of the month and month name (not numbers) i want this to run from the 1 to 31 on each month. i have a rough code, Sub Mine() Dim DateStr, FileStr As String DateStr = Format$(Date, "DD") FileStr = DateStr & ".docx" ActiveDocument.Save ChangeFileOpenDirectory "Z:\FIR MASTER FOLDER\FCR briefing sheet\2018\Test" ActiveDocument.SaveAs2 FileName:=FileStr, FileFormat:

MS Word VBA Find and Loop (NOT Replace)

我是研究僧i 提交于 2019-12-24 10:36:29
问题 Sorry for the fundamental question but I am a LONGtime Access VBA developer who is getting my butt kicked by Word. I am building a solution for someone who uses a Legal Case Management System with a specific numbering scheme (aaa-aaa-##-##-###). I need to search a document for hyphens and then grab the whole paragraph where a hyphen is found. I then need to send the text from that paragraph to a separate function which parses out the file number from the paragraph (this function already works

VBA word. HighlightColorIndex of a hyperlink returns 9999999

本秂侑毒 提交于 2019-12-24 10:35:38
问题 I'm writing a macro in Word to remove the highlighting from all hyperlinks highlighted with wdGray25 . The search for all hyperlinks is done by For Each oLink In ActiveDocument.Hyperlinks If oLink.Range.HighlightColorIndex = wdGray25 Then oLink.Range.HighlightColorIndex = wdNoHighlight End If Next oLink The problem is that highlighting from some hyperlinks highlighted with wdGray25 is not removed. By examining hyperlinks with Alt+f9 it appears that wdGray25 highlighting isn't removed from

Word VBA to find line starting with “Date:” and copy line to top of respective page

感情迁移 提交于 2019-12-24 10:19:28
问题 I'm new to VBA for Word (have used it a fair bit in Excel). I am trying to organise large word documents that contain copied and pasted emails. I want to find the date/time of each email and copy and paste it to the top of the page. All lines containing the date start with "Date:" so it is easy enough to find them. I wrote a code to try and copy them to the tops of pages but it currently pastes all of the date lines to the top of the document. I can see why, I just can't work out how to

word-vba macro unable to change font size of non English words

筅森魡賤 提交于 2019-12-24 10:17:46
问题 In a word 2007 document, I manually select a sentence containing both English & Bengali words of multiple font size. When I enter some numeric value in Font size list-box in the panel and press Enter, the whole sentence font size is changed successfully (including Bengali words). However when I select the same sentence in VBA word macro and in final line try Selection.font.Size=8 only English words' font size gets changed. What is the problem? I also tried to loop through each characters, but

Programmatically find username in c++?

本小妞迷上赌 提交于 2019-12-24 10:11:26
问题 I'm creating little application which make easy some task in MS Word. Application have to be imported in Word as macro, that's mean that have to be stored in some template folder which is under user. So I wan't to find out how to know what is the name of user , and what is version of windows , cause my username and folder location is not same as someone else. Is there any little bat code, or some function in c++ that can easy just take those two information and store it in variable, that I