Jump to content

Search the Community

Showing results for tags 'word range'.

  • 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 All, I got some examples on how to create a word document from autoit but I'm hung up on formatting. Specifically setting up ranges. The example at https://www.autoitscript.com/autoit3/docs/libfunctions/_Word_DocRangeSet.htm isn't helping. Here is what I am trying to do. I am creating a document one line at a time and need each insertion to have different formatting. This project I'm using autoit to create an outline. Here is an example of what I want. 1) Title A Subtitle XX 2) Title B Subtitle YY Subtitle ZZ For starters I am just trying to italicize specific lines or words. Here is a sample of code that I'm working from: #include <MsgBoxConstants.au3> #include <Word.au3> $sFile = @ScriptDir & "\Output\Agenda.doc" Global $oWord = _Word_Create() If @error <> 0 Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_Create Example", _ "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Global $oDoc = _Word_DocAdd($oWord) Global $oRange = _Word_DocRangeSet($oDoc, 0) ; Use current selection Global $myArray[5] = ["1) Title A", "Subtitle XX", "2) Title B", "Subtitle YY", "Subtitle ZZ" ] For $i=0 to Ubound($myArray)-1 $oRange.InsertAfter($myArray[$i] & @CRLF) If StringInStr($myArray[$i],"Subtitle") Then $oRange.Font.Italic = True EndIf Next The above code makes everything italic when I just want the lines with "Subtitle" in them italic.
×
×
  • Create New...