Thanks for any suggestions.
For x = 0 To Me.ListBox2.ListCount - 1 doc2open = contentlibraryfolder & "\Staff\BIO Text\" & Me.ListBox2.List(x, 0) & " " & Me.ListBox2.List(x, 1) & ".docx" If Dir(doc2open) = "" Then MsgBox "bio text not found for " & Me.ListBox2.List(x, 0) & " " & Me.ListBox2.List(x, 1) Else Set wdDoc = wdApp.Documents.Open(FileName:=doc2open) ' NEXT LINE IS WHERE IT THROWS AN 'OBJECT REQUIRED' ERROR IN THE NEXT LOOP AFTER SHOWING THE MSGBOX biotextshape(x + 1, 1).TextFrame.TextRange.text = left(wdDoc.Paragraphs(1).Range, Len(wdDoc.Paragraphs(1).Range) - 1) ' name biotextshape(x + 1, 2).TextFrame.TextRange.text = left(wdDoc.Paragraphs(2).Range, Len(wdDoc.Paragraphs(2).Range) - 1) ' title biotextshape(x + 1, 3).TextFrame.TextRange.text = wdDoc.Paragraphs(3).Range wdDoc.Close End If Next x
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE