Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-20-2016, 08:42 PM
gmaxey gmaxey is offline Dynamically select a TextBox based on range value Windows 7 32bit Dynamically select a TextBox based on range value 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
 

Tags
textbox, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro/VBA code to select ALL text in a textbox in microsoft excel and add a new row jyfuller Excel Programming 11 06-01-2015 08:49 PM
Dynamically select a TextBox based on range value select a cluster of point from a range based on x and y values sandcharles Excel 5 02-19-2015 06:15 AM
Dynamically select a TextBox based on range value Generating Print Labels Dynamically Based on SQL Server expinch Word 1 11-26-2014 10:05 PM
Dynamically select a TextBox based on range value Dynamically changing drop-down list based on selection? (Word Form) laurarem Word 1 02-21-2013 10:17 PM
Dynamically select a TextBox based on range value Display result in textbox based on the input of another textbox scarymovie Word VBA 5 05-16-2012 07:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft