Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-23-2012, 09:29 AM
jjfreedman jjfreedman is offline Retrieving content control value Windows 7 64bit Retrieving content control value Office 2010 32bit
Advanced Beginner
 
Join Date: May 2012
Location: https://jay-freedman.info
Posts: 39
jjfreedman is on a distinguished road
Default

If you want a date picker on a userform, first you need to get and register the file mscal.ocx. For that, visit http://www.fontstuff.com/vba/vbatut07.htm. Step 2 on that page also explains how to put the control on the toolbox and how to use it. The drawback here is that you need to have the ocx on every computer that will use the form, and it's no longer common.

If you stick with the content control, then you can get its value with the expression ActiveDocument.ContentControls(1).Range.Text -- just substitute the correct index in the parentheses to get the particular control you need. Alternatively, put a unique Tag value in that control, and use the ActiveDocument.SelectContentControlsByTag method to get the correct one. (That method returns a collection of content controls, but if your tag is unique then you know the collection contains only one control, so you can use the index 1 to get the control.)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving content control value Move to next content control cksm4 Word VBA 13 07-02-2019 07:48 PM
retrieving notes in outlook that were deleted donbmar Outlook 0 05-21-2011 12:18 PM
Retrieving content control value content control Word 2007 TessaLee Word 1 03-11-2011 12:51 AM
Package for CD with links to Windows media player content and Flash Shockwave content hectorh PowerPoint 4 10-15-2009 12:22 PM
Templates: automatic text generation from Rich Text content control Chickenmunga Word 0 10-01-2008 11:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:26 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