Jump to content

Search the Community

Showing results for tags 'microsoft word'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Categories

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I’m using AutoIt to extract data from an office doc. In outline the format of the doc was a coloured section title (not a heading in the Word sense), then a few lines in black. I keep getting a com error. Tried various things to eliminate: - Add com error handle – no better, after one failure, all other interaction failed. - Remove failing data – it just failed on the next data - Disconnect the Word object and reconnect every 100 interactions – no better. - Close all Word windows and start again – no better. - Run from start of doc to half way, then separately for the second half – Clear! It really looks like an interaction count limit between AutoIt and Word. I’ve reduced the program and the doc to a minimum. It usually fails on reading the ColorIndex of a word, but on this occasion reading a word-count. L 250, P 7 6 HIJ KLM L 251, P 1 12 ABC DEF L 251, P 7 6 HIJ KLM "C:\AutoIt_Word_Test\Word_Read_Test.au3" (39) : ==> The requested action with this object has failed.: For $iWrdIx = 1 To $oWDoc.Paragraphs($iParaIx).Range.Words.Count For $iWrdIx = 1 To $oWDoc^ ERROR I’m surprised I’ve never run into this before as have used AutoIt to drive Word and Excel many times in the last 15 years. Winows 7 Enterprise SP1, MS Office Word 2003, AutoIt 3.3.14.5 Opt('MustDeclareVars', 1) Func ConFmtWr($sCntrl, $a = "", $b = "", $c = "", $d = "", $e = "", $f = "", $g = "", $h = "", $i = "", $j = "", $k = "", $l = "") ConsoleWrite(StringFormat($sCntrl, $a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l)) EndFunc Func OpenOrGetWord($sDocPath, ByRef $oWord, ByRef $oWDoc) $oWDoc = ObjGet($sDocPath) ; (Good if doc is already open or not. Surprise) $oWord = $oWDoc.Parent $oWord.Visible = 1 ConFmtWr("WC %4d\n", $oWDoc.Words.Count) ConFmtWr("PC %4d\n", $oWDoc.Paragraphs.Count) EndFunc Local $oWDoc Local $oWord Local $sDocName = @ScriptDir & "\Test.doc" Local $iWrdIx Local $iParaIx Local $iColrIx Local $sWrdText Local $iLoops OpenOrGetWord($sDocName, $oWord, $oWDoc) $iLoops = 0 While 1 For $iParaIx = 1 To 10 $iColrIx = $oWDoc.Paragraphs($iParaIx).Range.Font.ColorIndex If $iColrIx <> 1 Then ConFmtWr("L %4d, P %4d %2d %s\n", $iLoops, $iParaIx, $iColrIx, $oWDoc.Paragraphs($iParaIx).Range.Text) For $iWrdIx = 1 To $oWDoc.Paragraphs($iParaIx).Range.Words.Count $iColrIx = $oWDoc.Paragraphs($iParaIx).Range.Words($iWrdIx).Font.ColorIndex $sWrdText = StringStripWS($oWDoc.Paragraphs($iParaIx).range.Words($iWrdIx).Text, 3) Next EndIf Next $iLoops += 1 WEnd Test.doc
  2. 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
×
×
  • Create New...