Use Access to read information from the Word selection. Show the text that's selected on an Access form. If fields are found, document them. If fields are document properties (DOCPROPERTY), show the property name.
This is part of an application to control Word Document Properties from Access.
00:01 I'm developing an application in Access to control values of document properties in Word.
00:18 shared code to list open Word documents
00:21 posted code and made a video about how to define and embed Word Document Properties and fields, in Word
00:48 There are 2 Word documents open.
01:11 click List Open Documents,
01:55 VBA code that runs when Read Selection is chosen
02:01 global object variables
02:16 list other procedures that are called
02:41 calls SetFieldInRange
02:46 object variable for a Word range
03:02 conditional compiler constant
03:13 Call ListOpenDocuments if the Word application variable isn't set
03:54 clear the previous selection data on the form
04:33 Field Code is what Word stores
04:52 DocProperty field
05:18 set the oRange object variable
05:39 pass range to SetFieldInRange
05:54 Early or Late binding
06:05 For Each loop
06:27 Back to ReadSelection code
06:41 read values from the global field variable
07:04 Word property video goes into details about format codes
07:24 property or field name
07:30 write to form controls
07:60 goal of this application
08:13 Access and Word work very well together
08:19 custom training
** Related links **
Word Document Properties (Built-in and Custom) are a great way to substitute data in your document all over! ... in many places or just one.
video for Word Document Properties and Fields, in Word
• Word Document Properties and Fields
Word VBA to list names and values for Built-In and Custom Document Properties
https://msaccessgurus.com/VBA/Word_Do...
Listbox with Open Word Documents
VBA for ListOpenDocuments
https://msaccessgurus.com/VBA/ListOpe...
***
Do you have information in a database (or should you?) that you want in a Word document? Let Access do the driving!
kind regards,
crystal
Remote Training and Programming
Let's connect and team-develop your application together. I teach you how to do it yourself.
https://msaccessgurus.com