View Single Post
 
Old 07-20-2016, 08:42 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

I never implied that you were searching for the contents of the textbox. I only implied that if you used named content controls instead of ActiveX controls and knew the named control is present in the document then you could refer to it explicitly by name.

With ActiveX controls you will have to loop:

Code:
Sub ScratchMacro(strNamePassedFromExceRange as String, strText)
'A basic Word macro coded by Greg Maxey
Dim oILS
  For Each oILS In ActiveDocument.InlineShapes
    If oILS.OLEFormat.Object.Name = strNamePassedFromExcelRange Then
      oILS.OLEFormat.Object.Value = strText
      Exit for
    End If
  Next oILS
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote