View Single Post
 
Old 01-28-2014, 11:44 AM
ilcaa72 ilcaa72 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Jan 2014
Posts: 27
ilcaa72 is on a distinguished road
Default How to Pass Document to this Sub

I am not the most versed in VBA so needed some help. I have this function but I am not sure how to pass the current document as the input.

Here is the beggining of the procedure, please advise how i reference the current document as the "Sentences" to use as the input to this function..

Code:
 Function GetSentences(ByVal Sentences As String) As Collection

'Delete space
 Sentences = Trim(Sentences)
 
 Dim sList As New Collection
 Dim RE As Object, REMatches As Object
 Set RE = CreateObject("vbscript.regexp")
    With RE
        .MultiLine = False
        .Global = True
        .IgnoreCase = False
        .Pattern = "(\S.+?[.?])(?=\s+|$)\s"
    End With
 
....
 
End Function
Reply With Quote