Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-03-2023, 12:21 PM
gel gel is offline How to go from static external data source in a Docvariable to userform input of dynamic text & date Windows 10 How to go from static external data source in a Docvariable to userform input of dynamic text & date Office 2013
Novice
How to go from static external data source in a Docvariable to userform input of dynamic text & date
 
Join Date: Jan 2023
Posts: 1
gel is on a distinguished road
Question How to go from static external data source in a Docvariable to userform input of dynamic text & date

Graham Mayor’s website includes an example and demonstration of how to create a userform which is located on his Word Pages Tab. The final example covers a userform containing a pair of multi-column list boxes. His illustration attached.



The data to populate the listboxes is taken from an external word document containing two tables. The second table has as its columns the name of the document which is displayed in the list box and the second column contains “content of letter1”, “content of letter2”, etc. When the selection is made from the first column “DocName1” the corresponding “content of letter1” is imported into a Docvariable Field contained in the document. This works perfectly for the contents of letters that are static and never change.

I am considering an attempt to modify the demonstration to accommodate situations where the letters content can be modified. The various letters content would need from one to about six fields of data some with dates and some with text.

My question is how best to modify with the minimum change to the structure of the demonstration to allow user input by way of textbox entry on the userform? Is it practical to include in a module the code necessary to find and place bookmarks in the “letter1” text, or whichever letter was selected after it has been imported into the Docvariable, where the dynamic data should be inserted with a corresponding series of textboxes conditioned upon which selection is made to display on the userform for entry of the data for insertion for each bookmark?

Does anyone have thoughts on whether there is a better and simplier or more direct way to accomplish the desired result?
Attached Files
File Type: pdf 1701_0001.pdf (46.7 KB, 4 views)
Reply With Quote
  #2  
Old 02-03-2023, 10:29 PM
gmayor's Avatar
gmayor gmayor is offline How to go from static external data source in a Docvariable to userform input of dynamic text & date Windows 10 How to go from static external data source in a Docvariable to userform input of dynamic text & date Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The example from my web site is very old and demonstrates a way to populate a userform from an external table. Personally I would now use content controls (which were not available when I created that particular example) to populate the document. The code to populate content controls is listed on that same web page.

If you want you can use text boxes for user input and write the values to the content controls and similarly you can read the contents from the controls back into the user form for editing.

My friend Greg Maxey has several examples for userform creation on his web site that should help you get the results you require.
Microsoft Word Help, Tips and Tutorials @ The Anchorage
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Save as Text to External Data Source Directory Baiano42 Excel Programming 2 06-29-2019 09:42 PM
Userform with Multiple Cascading Drop Down Lists Populated with External Source Data venganewt Word VBA 21 05-16-2018 02:05 PM
How to go from static external data source in a Docvariable to userform input of dynamic text & date Excel data linked to external source Doug Needham Excel Programming 1 09-15-2015 05:14 AM
How to go from static external data source in a Docvariable to userform input of dynamic text & date vba change external data source excelledsoftware Excel Programming 1 07-17-2012 04:22 AM
How to go from static external data source in a Docvariable to userform input of dynamic text & date Refresh of data from external source Jirik61 Excel Programming 3 07-13-2012 01:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:12 PM.


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