This is a Microsoft Word document with a lot of information
coming from fields containing document properties.
When the value of a document property is changed,
everywhere it is referenced also changes.
No find and replace needed, just update the document!
Access manages this very well,
but first we start with Word itself.
I'll show you how to define and use
built-in and custom Word document properties.
I also shared VBA code on MsAccessGurus.com
that you can run to make lists of property names and values.
hi, this is crystal.
There's lots of fields here, shaded in gray,
with information coming from document properties.
To see document properties, go to File, Info
On the right you can see some of the built-in properties.
I'm sure you recognize some of these: file size,
the number of pages and words,
Title, Comments,
when the file was created and modified.
At the bottom of the list,
you can click Show All Properties to see the rest of them.
You can change the values right here.
Back at the top,
if you drop down Properties,
you can you click Advanced Properties.
A dialog box opens.
The Summary tab shows built-in properties.
You can change values here too.
The Custom tab shows properties that you define.
The top list box is for suggestions.
They aren't properties that are already created.
That can be a little confusing.
The bottom list shows the custom properties
that I've already set up, and there are several of them.
Click a property to pick it for editing.
It's name, data type, and value are displayed
in controls that you can change.
The new date due is March 2.
change the value, and click the Modify button.
The company name is also wrong.
aCompany is supposed to be to ABC Company.
Make changes and click Modify.
Make a new custom property for the Phone number.
Type the name, which will be aPhone.
I like to name custom properties starting with little 'a'.
Check the data type, text is good.
Enter the value, and click Add.
Now aPhone is at the bottom of the list.
This dialog box can't be resized,
but the form I'm building in Access shows everything nicely.
OK, we're done here for now.
Go back to the document.
Now, let's use our new property.
Type some text and then,
to insert a field, go to the Insert ribbon,
then in the Text group, Quick Parts
On a bigger monitor, the ribbon expands
so Quick Parts is easier to see.
I'm recording this at 1280x720.
Word offers some choices at the top,
and these appear to be my recent AutoText entries.
There's a scollbar, so there are more suggestions.
Here's Field... Insert Field near the bottom.
In the dialog box, on the left is a list of field names.
There are lots of them.
Click in the list and type D to get closer to DocProperty, and then select it.
The Property list in the middle shows custom and built-in properties.
The custom properties are at the top of the list since they all start with 'a'.
The end of the list shows the built-in properties
iField_DocProperty_endProperty list, Title
I'll choose aPhone and click OK.
There it is!
Remember we changed the company name?
Why is it still showing the old value?
The field needs to be updated.
Right-click on a field and choose "Update Field" from the menu.
Date Due still has the old value too,
and more of them might have changed.
Press Ctrl-A to select the whole document,
right-click on the selection, and choose "Update Field".
Now Date Due is updated to the value I put in there.
Hmm, I think all the years are off by 1.
Luckily that's easy enough to change.
Let's change the date format to show the day name.
Right-click and Toggle Field Codes
dddd, 4 little d's, and then a space
before the month name will give us the name of the day.
Capital M is for month since little m is for minute.
Now right-click and choose Update Field.
Normally, you probably wouldn't show field shading for everything.
How do we change that?
Go to File, Options, and Advanced.
In the Show document content section,
change Field shading from Always to When selected.
OK.
Now the field shading doesn't display unless it is in your selection.
At the bottom of the sample document is a section with Important Dates
that need to be filled out,
so you can get practice inserting fields.
Instead of going through the ribbon,
I customized my Quick Access Toolbar with the Insert Field command.
There's a link to the video description
to another video I made about customizing the
Quick Access Toolbar, or QAT,
which works the same way in Word as it does in Access.
Scroll down to DocProperty,
and the first one we want is survey date.
Pick that and OK.
The next date is the deadline for questions.
Insert Field, DocProperty, then aDate_Questions.
This time I'm going to click Field Codes in the lower left.
At the end of the field code, we're going to add a format.
Field codes are delimited with spaces,
and there is already a space at the end.
\@ then space then the format code in quotes.
I'm using "dddd, MMMM d, yyyy"
to get the day name, month name, day number, and 4-digit year.
For the last date, let's copy and paste,
show field codes, and change the field name to aDate_Due.
In case you're wondering, case doesn't matter.
Now update the field, and there it is!
Hmm, maybe toggle field codes and use 4 M's for the full month name, MMMM.
Then update the field.
If you want do these steps yourself,
you can download this sample document from
MsAccessGurus.com, VBA, and then Word Document Properties
https://msaccessgurus.com/VBA/Word_DocumentProperties.htm
Go to Download in the Quick Jump list
and on this page, you also find steps you can follow
so you can use the sample
and get the VBA code into your Normal template
so you can run it on any document.
The link is in the video description.
This page has a lot of information that will be helpful to you
when you start using document properties
I'll scroll through a bit of it.
Steps to change built-in document properties,
How to show Word document properties in File Explorer,
How to create custom properties,
How to insert document properties using fields,
Entering format codes,
Updating values,
Toggling field codes,
and this is just halfway down the page.
It's a long web page.
Here you will also find VBA code
you can put into your Normal template
to list the names and values of all the document properties in any Word document.
If your Developer ribbon is showing
from the Developer ribbon, click Macros in the Code group.
The shortcut key for Macros, is Alt-F8,
and that's the same in Excel, and PowerPoint.
If you want to turn on the Developer ribbon, go to Options,
Customize Ribbon, and check Developer, near the bottom.
Choose the macro that you want.
This macro is called a_list_WordDocumentProperties_s4p
and click Run.
When it's done, tables are added to the end of the document
showing the names and values of all the Built-in and Custom properties.
After you look at the lists of properties,
you can either copy them to somewhere else, or delete them.
One advantage of using properties is that
several of the built-in properties can be displayed in columns of File Explorer.
In the Details view, right-click a column heading and choose "More..." from bottom of the list.
I'm choosing Title, Authors, Company, Comments, and Subject.
Remember you can type a letter to move around this list quickly.
There are a lot of other columns showing
so the ones just added are way off to the right.
I'm turning other columns off,
dragging to move, and resizing.
A lot more information shows up on a bigger monitor.
if you want to try this yourself,
create a new module in your Normal.dotm template,
copy and paste the VBA code,
name the module, then compile, and save Normal.
Download the zip file with the sample Word document
Unblock the zip file
Extract Word document from the zip file
Open the Word document
Run the code to list the properties and look at the results!
Fill the important dates by inserting DocProperty fields.
Experiment with format codes.
Maybe you also want to edit property values
and then update the document?
Can this technique be useful for you?
I still use other methods like bookmarks to mark positions
for inserting external images, creating multiple records, and other things.
Do you have information in a database that you want to insert into Word documents?
Or do you have a bunch of documents that you're constantly manually changing?
Do you want to streamline your process?
Let's connect and team-develop your application together.
I teach you how to do it yourself.
email me, Training@msAccessGurus.com
Thanks for joining me.
Wishing you the best success.
and I want to wish someone special a very happy birthday today
(humming) Happy Birthday to you