Results 1 to 8 of 8

Thread: word automation

Hybrid View

  1. #1
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: word automation

    Here is some pseudo code:
    Add a Reference to Word Library, and make the appropriate changes (ie Application will become your Word Object reference)

    VB Code:
    1. Sub ReadWord()
    2. Dim strArr() As String
    3. Dim intCount As Integer
    4. Dim intIdx As Integer
    5.  
    6.     'Capture the Word Text
    7.     ActiveDocument.Select
    8.  
    9.     'Load an Array with each line
    10.     strArr() = Split(Selection.Text, vbCr)
    11.  
    12.     intCount = UBound(strArr) - 1
    13.  
    14.     For intIdx = 0 To intCount
    15.         MsgBox strArr(intIdx)
    16.     Next
    17.  
    18. End Sub
    Last edited by Bruce Fox; Dec 14th, 2005 at 07:14 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width