Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Private Sub OK_Click() 'hide form findProposal.Hide Dim path$ 'gets the path for the word file path$ = findProposal.Label1 GetWordDoc (path$) End Sub Function GetWordDoc(strPath As String) As Boolean Dim objDoc As Object, objRange As Object, objAppWord As Object Dim strNewPath As String Dim wks As Worksheet Dim n As Long Dim varLookup On Error GoTo err_handle GetWordDoc = True Set wks = ActiveWorkbook.Sheets("MergeSheet") Set objDoc = GetObject(strPath, "Word.Document") Set objAppWord = objDoc.Application For n = 1 To objDoc.Words.Count 'this is the problematic line: If Left(objDoc.Words.Text, 3) = "FLD" Then End If nextn: Next n clean_up: objDoc.Close Exit Function err_handle: MsgBox Err.Description GetWordDoc = False Resume clean_up End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.