Jump to content

Search the Community

Showing results for tags 'word'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start






  1. Dear all, I am working on automation of ms word, on which my scripts runs with multiple word document at a time. But I wanted all the word to be running in the background. do we have any UDF available? Please help. BR, VinMe
  2. Hello, I wrote a small AutoIt App which takes DOS formatted textfiles and forwards them to MS Word. I searched a lot for a programm which does this, but I didn't find one. The reason for it is an old DOS program, which is used a lot, even today. The user wanted to print the output of that programm with some other font-size, font-style and so on... We used WinPrint, but this is a printing only app, so no formatting can be done afterwards... The solution was, to print with the DOS prgramm to an file, e.g. C:\12345\output.txt ... then read this file, convert it to unicode, put this
  3. Hello, so I have started to learn to use the Word UDF and got issue to add my pictures after exact paragraphs. I was searching in the forum for the solution, checked with examples and still I don't understand how to add pictures after paragraph in new line. My word document has like 8 pages and for example on page I have paragraph named "My examples:" and here starts my problem. I have tried to do this: #include <Word.au3> Local $oWord = _Word_Create() Local $oDoc = _Word_DocOpen($Word, @ScriptDir & "\examples.docx", Default, Def
  4. I'm trying to get the number of columns in a specific row in a Word table and am stuck. I need a push. Program below and Word file attached. Thanks. #AutoIt3Wrapper_run_debug_mode=Y ;use this to debug in console window #include <Word.au3> $oWord = _Word_Create(True, True) ;Create Word application object, make it visible, and force a new instance of Word $oDoc = _Word_DocOpen($oWord, @ScriptDir&"\ColumnTest.docx", Default, Default, True) ;Open the Word document $iTablesCount = $oDoc.Tables.Count ;get Tables count in $oDoc Pause("$iTablesCount = &#
  5. Hello! i wrote this function as alternative to using the Com Object or Commandline version of this project, discussed also earlyer on this forum. Project site - http://ebstudio.info/home/xdoc2txt.html Advantage of this implementation is that you do not need to register Com dll, using regsvr32. But you still need the project Dll (xd2txlib.dll). Enjoy! ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ExtractText ; Description ...: Extracts text from advanced documm
  6. Hello, I am trying to save an word document but it won't work , This is my REALLY simple script: #include <Word.au3> Global $oWord = _Word_Create(False, True) _Word_DocSaveAs($oWord) MsgBox(0, @error, @extended) And my MsgBox: I know that its a COM error because @error is set 2... but what about the COM error code? I cannot find anything related to -2147352570!
  7. I have a Word document containing a 9-column table where row 1 is the column headers. My goal is to read the table into a 2d array, remove some rows, update some fields, and add a few rows to the end. The resulting array will likely be a different length. Next, I want to write the data back into the table. If it's easier, I can write the data to a new document from a template containing the same table header with a blank 2nd row. Here's my early attempt: Local $oWord = _Word_Create() Local $oDoc = _Word_DocOpen($oWord, $sFile) Local $aData = _Word_DocTableRead($oDoc, 1) $aData[3
  8. Backstory: Our Microsoft Office Templates shared folder was changed from a DFS share to an Isilon share. example: Old Server: \\Domain.com\Office\Templates New Server: \\Templates.domain.com\Office\Templates The team making the changes overlooked that several hundred thousand documents, had been attached to the old template documents. So when you open a document which has been attached, it will take a couple of minutes to open, while it tries to locate the old server path. I've been asked to come in and fix it, so after several hours found that the data is being held in docu
  9. Good evening everyone I am working with Word UDF ( thanks @water! ), and, especially, with the function _Word_DocFindReplace(). The replace does work everywhere in the document, but, it does not work in Headers or Footers. Am I missing something or am I forced to use the code below? I have already looked in the Help file ( about _Word_DocFindReplace() ), but there are no mentions about replace text in Headers/Footers. Sub FindAndReplaceFirstStoryOfEachType() Dim rngStory As Range For Each rngStory In ActiveDocument.StoryRanges With rngStory.Find .Text = &
  10. Hello, im working on a Script that should change a high amount of Word Templates at once. Target is to open each Templatefile (.dotx) in a specific folder and do the following steps: Add a page break at the end of the document (works) Add a text on the created Page (works) Change the headerstyle to blank for the new page and the following (missing) Add a heading between two specific headings (missing) Can please someone help me to add the 2 functions to the script? #include <word.au3> #include <File.au3> #include <array.au3>
  11. Hello Is there anyway to store word documents in Autoit GUI? For example I have a instruction sheet that I want to bundle up with the exe. So a user simply clicks the icon and the stored document will launch (Something like how you can add objects like excel sheets in word documents ) (I Know we can launch word files from script directory)
  12. I've failed to find an example of _Word_DocFindReplace which searches for formatted text (I'm looking for stand alone paragraph marks that are formatted other than normal i.e. Bold Italic, Underlined). The reason being that when converting a Word document to html one of the main problems in the results is that a stand alone paragraph mark is converted to an html space that retains the formatting ...>&nbsp;<... thus showing up as a underline _ in a browser when it should be blank. I've played around with the script and got it to at least un-bold the first paragraph mark regar
  13. I'm using the Word UDF for the first time, and I'm having some trouble with _Word_DocFind(). There isn't really much talk around the forums about this so it's hard to find any support on the issue I'm having. Here's my code: #include <Word.au3> $listPath = @ScriptDir & "\AMCH OFFSET 042617.docx" $pWord = _Word_Create() $oWord = _Word_DocOpen($pWord, $listPath) Local $ctr = 0 Local $searchRange = _Word_DocFind($oWord, "Claim Number") If Not @error Then $ctr += 1 EndIf While ($searchRange <> 0) $searchRange = _Word_DocFind($oWord, "
  14. Good morning everyone I am working on a little script, which takes some data from a SQLite DB and should create a sort of report, inserting rows in a Word Document... I arrived at the point of: _Word_DocTableWrite() and, I don't know how to set the range parameter? What does that specify? Thanks a lot for the help EDIT: Managed to write a table in the Word document, but now I get an error when I save the document with _Word_DocSaveAs(), with error 2. Which are possible causes? Thanks a lot, again EDIT 2: ... And, how can I set a border to the table
  15. I'm attempting to read each line of a word document and assign the line to a variable. Similarly to how you can read a line from a text file (.txt or .csv) using FileReadLine(). So far i have been unsuccessful in reading from a .doc/.docx file, nor have i found any documentation that has helped. In searching for a solution i did find a function to convert the word doc to a text file, however my script is for (PCI) auditing purposes and i do not want to create a new file on the HDD. I have also read through the _Word UDF help files... Unless im not understanding the _Word UDF correctly, I d
  16. Hi Guys, Firstly, thanks for your help in the past. I have a new activity I need to accomplish. In summary: * need to read a cell in excel (containing a file name) * open the file name in word (as its a word document *copy the word document *paste the word document into the master document *read next cell in excel ... and repeat until you reach the bottom of the column. I can read cells open workbooks etc. But as far as copying and pasting in word - where is the best place to start, and what functions should I be looking at. Or eve
  17. Hello I would create a KWIC (Key Word in Context) index, and for this I need to access to a paragraph style. But the style returned is empty. I realized this function as Word macro without problems (If anyone is interested can download it from www.condorinformatique.com). Here is a fragment I used: $oWord = _Word_Create() Global $sDocument = "C:\D\Condor\Documentazioni e Progetti\ContextIndexMS\cIndex.doc" $oDoc = _Word_DocOpen($oWord, $sDocument) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocRangeSet Example", _ "Error opening '.\Ext
  18. Hi all (Especially @water) I wonder how to do this task in word from autoit. Assume that i pasted some text into word with this code. Local $oWord = ObjGet("","Word.Application") Local $wRangeObj = _Word_DocRangeSet($oWord, 0) Local $data = ClipGet() $wRangeObj.Text = $data $wRangeObj.Font.Bold = True So far so good. Now, i need to enter a new line in word and turn the Font.Bold = False. Currently, i did it with activating the word window and Send() function. But i would like to do it with the help of COM object. How can i do that
  19. I am testing intercepting com errors in Word and I have found a possible bug in the UDF, it might not be a bug it just means a workaround. I have found the com error bug in _Word_Create Func _Word_Create($bVisible = Default, $bForceNew = Default) Local $oAppl, $bApplCloseOnQuit = False If $bVisible = Default Then $bVisible = True If $bForceNew = Default Then $bForceNew = False If Not $bForceNew Then $oAppl = ObjGet("", "Word.Application") <------- here is the line which causees com error This happens in the following example #include <Word.a
  20. Hello Guys, I'm trying to open a document with _WordDocOpen and replace some text in it with _Word_DocFindReplace and then print with _Word_DocPrint and finally close with _Word_DocClose and kill word with _Word_Quit. Works perfectly. My question is (can't find an answer anywhere): Can i do those commands in the background so i don't see word opening and replacing everything? Can't find anything in the proprieties of "WordDocOpen". Thank you. Flo
  21. Trying to find a quick way to convert 30k+ WordPerfect files into Word. Will probably run it locally from an admin machine or server so user permissions won't affect it. My idea was just to open the file, select all, copy, open new word doc, paste, file, save.... What would be the best way to go about scripting something in this way?
  22. I am struggling to insert a row in a table in a Word document. $oDoc = _Word_DocAttach($oWord,"test.docx","FileName") $vRange = $oDoc.Tables(1).Rows(1).Select ; <-- ok - does select $vRange.Selection.InsertRowsBelow ; fails The documentation I have is (VBA) :- ActiveDocument.Tables(1).Rows(2).Select Selection.InsertRowsBelow I do not know why the autoscript is failing on this line $vRange.Selection.InsertRowsBelow I cannot specify Selection.InsertRowsBelow as the statement does not compile. Help appreciated.
  23. I cannot get the method movestart to work in my program $oRange = _Word_DocFind($oDoc, "3 4") ; return a range $oRange.MoveStart($WdLine,-1) ; supposed to move the start range to the beginning of the line I get an error '... requested action with this object has failed.' I have seen this statement used in Word.Udf, but cannot see why my statement is failing. Help appreciated.
  24. All, I need some help with the following: 1. Finding an image in a Word doc. I have read the help file but I cannot figure out how to reference the image in the Word doc. 2. Adding a hyperlink to that image. 3. How would I loop the add hyperlink (text) and add hyperlink (image) to replace multiple links in a document. I have the add image and hyperlink working with the following code: $pic = "<PHOTO>" $picpath = IniRead(@ScriptDir & "\Config\Config.ini", "User Info", "Picture", 0) Local $oRange = _Word_DocFind($oDoc, $
  25. Hi all, I am trying to change the background color of a page in word document. But i am getting error. This is my code. Local $owObj = ObjGet("","word.application") If @error Then ConsoleWrite("Obj Error " & @CRLF) Local $odoc = $owObj.ActiveDocument Local $colorArray = [136,151,109] ; Olive Green $odoc.Background.Fill.ForeColor.RGB = _ColorSetRGB($colorArray) $odoc.Background.Fill.Visible = True $odoc.Background.Fill.Solid() If @error Then ConsoleWrite("Error in Color change - " & @error & @CRLF) $owObj = 0 ExitAnd this is the
  • Create New...