none
VBA Find in a text box RRS feed

  • Question

  • I recently upgraded from Office 2004 for Mac to Office 2011 for Mac.  I had a VBA macro which worked in a text box which I chose to identify by the text contents of the box.  Under 2004 I was able to used a Selection.Find.Execute(findText:="Calendar", Forward:=True) = True test to activate a loop to do the editing.  It no longer works in 2011.  It appears that the problem is that the text box in which the desired text is  located is grouped with other shape elements.  If I ungroup everything, it works with a tweak.

    If I "debug.print Selection.Find.Execute(findText:="Calendar", Forward:=True)", I get True and False as I expect (after ungrouping everything), but that test does not work in the test "if Selection.Find.Execute(findText:="Calendar", Forward:=True) = True then"  It never goes to the true condition.  However if I set a variable myTest = Selection.Find.Execute(findText:="Calendar", Forward:=True) and then do the if with myTest, it works fine.  Obviously something has changed with the 2011 implementation.  Is identifying the changes left as an exercise to the student?

    Tuesday, January 21, 2014 8:54 PM

Answers

  • Hi,

    According to your description, you encounter a VBA issue when upgrading from Office 2004 for Mac to Office 2011 for Mac. So I think your question is related to the Office for MAC.

    Since this forum is to discuss problems of Office development for Windows OS, I suggest posting it in Office for MAC support for more efficient responses.

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 22, 2014 5:45 AM
    Moderator