Jump to content

Search the Community

Showing results for tags '_word_docattach'.

  • 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 1 result

  1. Hi Everyone First time I post in the Office section. Problem I have is that I can't figure out the _Word_DocAttach() Helpfile function. I think the HelpFile example may not actually work. What is it supposed to do? Concatenate Test.doc to itself? #include <MsgBoxConstants.au3> #include <Word.au3> ; Create application object Local $oWord = _Word_Create() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocAttach Example", _ "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Open test document read-only $sDocument = @ScriptDir & "\MyLetterHead.docx" _Word_DocOpen($oWord, $sDocument, Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocAttach Example", "Error opening '.\Extras\Test.doc'." & _ @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Attach to the test document by "FileName" and set focus to the window ; ***************************************************************************** ;$Body = @ScriptDir & "\MyLetterBody1.docx" ;$Body = "MyLetterBody1.docx" $Body = "Test.doc" Local $oDoc = _Word_DocAttach($oWord, "Test.doc", "Filename") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocAttach Example", _ "Error attaching to '"&$sDocument&"' by '"&$Body&"'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Set focus to the word document - $f_takeFocus parameter of the old _WordCreate function WinActivate($oWord.ActiveWindow.Caption & " - " & $oWord.Caption) MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocAttach Example", "Attach to document by 'FileName' successfull!" & @CRLF & _ @CRLF & "Text of the attached document:" & @CRLF & $oDoc.Range().Text) I have (in the same folder) @ScriptDir my AutoIt script (above), as well as the two Word DocX files. That Test.doc is actually the file from the AutoIt HelpFile install... My understanding of the syntax is Local $oDoc = _Word_DocAttach($oWord, "Test.doc", "Filename") --> use the Object $oWord (previously opened) --> and attach to it the document "Test.doc" which you search for based on its Filename I can't get this to work. Skysnake
×
×
  • Create New...