Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this lesson we are going to work with a very useful feature, particularly when working with long documents. I'm talking about Field Codes. Now even if you have never seen a field code before, you have probably used them. For example, if you have ever added automatic page number into a document, you have inserted field codes, codes that say where the page is going to appear and what it's going to look like. You see the results and not necessarily the code itself. Maybe you have inserted the current date or you have done mail merging, you have used field codes without maybe even seeing the code itself.
Well, in this lesson, we are going to dive a little bit deeper into field codes. In a previous lesson, as we created a cover page, we had a code sitting there,waiting or us to enter the title or sub-title of a document, for example. Those are prompts that we can also create using field codes. We will do that as well in this lesson. Right now though, you can see, I have got the document called HumbugBlocks3 open. It's in the Chapter 6 folder of your Exercise Files if you are following along. Go ahead and open that one up and I'm going to go right to the end of this document. Ctrl+End on my keyboard takes me to another building block that I worked with in a previous lesson for my Table of Figures.
Down below is the actual marker where the Table of Figures will appear. Right now I see the results, which is the following text, "No table of figures entries found". Eventually I'll see a list of figures appear here as I go through my document and mark them, but for now I'm seeing the results of the code. The code itself can be viewed if you click on it. I'm going to click right here on "No table of figures". Notice how the whole thing gets highlighted or selected, indicating it is a code. Now there are some keyboard shortcuts for looking at codes.
First of all, with it selected, I can hold down Shift and press F9. When I do that, I'm going to see the actual code itself. Notice that it's kind of like a table of contents code with some backslashes and some characters, in the double quotes I see the word "Figure" indicating this as a Table of Figures. When I hold down Shift and press F9 again, I see the results and hide the code. So I can toggle back and forth. Another option, if you just click out on your page somewhere, to see all of the field codes, you can hold down Alt and press F9. That will show you all of the field codes in your document, not just the one that is on your page currently.
For example if I scroll up, you can see the page code that shows up in the bottom right hand corner of the previous page and if I hold Alt+F9 down again, I see the results now instead of the code itself. So let's try inserting one of the codes you have access to here in Word. I'm going to hit Enter a whole bunch of times and maybe you want the current year to appear right here on your page. Well, instead of typing it in, if you want it to be updated automatically next year, it will show up with 2010 for example, you could do that just by going up to the Insert tab.
Now we are not going to go to Date and Time to insert the date and time code, we want to be more specific by going to Quick Parts and then down to Field from this list. By clicking on Field, we will open up our Field dialog box. Now you are probably seeing here from the dropdown, all categories, which is a huge long list of field codes that can be entered. Well, if you go back to the Categories dropdown, you will notice that there are some categories that you have probably used in the past like Date and Time. Here is where we are going to go to choose a Date and Time code to appear on our document. So that's going to be a date or time or a combination of both.
We have got Document Automation. That's where we get to prompt people for information. We will come back to that momentarily. Document information like page count for example, who is the author, equations and formulas, index and tables, if you have ever done a table of contents or an index, you have to use field codes. There is Mail Merge there. There is Numbering for page numbering, for example. But we are going to come up here to Date and Time and give it a click. This displays Date and Time field names like Create Date. If I click on Date, you can see it's going to insert the date here. Edit Time, Print the Date, Save the Date Time.
I am going to go up to Create Date and check out the date formats. There is nothing in here that gives me just the year. It's always in combination with the month or the day. I have got times down here as well. I'm going to this one right here, 7 January 2009. You can see the date format up here as day, month and year. If I come down here to Field Codes, you are going to see the actual code that is going to create that. So I can edit it right here, I could take out the day and the month.
I am not going to do that, I'm going to go back down here and hide codes for a second and just click OK to insert it. Because I know with a code that's been placed on my page, I can click on it and do a Shift+F9 to see the field code itself. That's the exact same field code I saw a moment ago in the dialog box and I can come in here to edit it if I want. So I'm going to take out the day and the month, just leaving the four placeholders for the year. Now when I do a Shift+F9, I see the result, not the results I'm working for, it just hasn't been updated yet. To update this, it has to be selected. You press F9 on your keyboard all by itself. I'm going to do that now and there is the end result, 2009. I'll click outside that code to deselect it and there is the result. So, next year it will say 2010, the year after that 2011 and so on.
So that's just one of the built-in codes of many that you can choose from. Of course, we can access those codes other ways, like the Date and Time, dropdown here a button from my Text section of the Ribbon. Of course, if I was doing Page Numbering and Cover Pages and things like that, they can be inserted as well all from here, but I can access them and manipulate them using Quick Parts and selecting field. Now what if I want to prompt somebody to enter something? I'm going to create my own cover page, which will be a building block eventually. So I'm going to go up here to the top left corner, click our button and go down to New, create a new blank document by making sure Blank Document selected, click Create.
First thing I'm going to do is just create a text box. I'm going to insert a text box. I'm going to go up to my Insert tab here and I'm going to go over to Text Box, click that dropdown and I'm going to scroll through the list of presets here until I find something I like. I'm going to use this one right here, Contrast Sidebar, and I'm going to click on this little field right here and just hit Delete to remove it. Instead I want to put in my own code here that's going to prompt users to type in the title of this document. So I go up to my Insert tab, go over to Quick Parts and down to Field.
Now here is how we create a prompt. We go up to Categories and down to Document Automation. We are going to create a Macro Button and you can see there is a whole bunch of macro names here. If I go to Field Codes, to see the field code, it's actually Macro Button and then the default here is Accept all changes in Doc. That's not what I want. I want a prompt. So in this case, I'm going to come in here and take all of that out. You can select it and delete it or use your delete key, backspace key. Once it's gone, we are going to make a noname macro button here. So I'm going to type in noname just like that. Leave a space and now in square brackets, the prompt. This is what I want people to see. I'm going to type in this, Type Document Title Here.
I'm going to close it up with the square bracket. I have actually created my own field code now. When I click OK, that's exactly what I see, the results, the text that I entered, not the entire code but you know, you can click on that and press Shift+F9. There is my macro button code. So I can make changes to it right from here if I needed to. Shift+F9 again and it's going to take me back to the results and I'm going to click outside of this. All right, next thing I'm going to do is create a building block out of this. We have done this in a previous lesson. First step, go up to the Home tab, over to Select and Select All. Ctrl+A would also work if you want to use the keyboard. With everything selected, we want to create a building block out of this. We go up to Insert, over to our Quick Parts and this time right to the very bottom, Save Selection to Quick Part Gallery.
So I'm going to click here and I'm going to type in a name. Let's do My Custom cover page, just like that. It's going to go the Quick Parts Gallery by default. If you wanted it to go to your cover pages, you could do that. I'm going to choose Cover Pages. It's a built-in category saved in Building Blocks, Insert the Content Only, we have got the other option here, Insert content in its own page, which is what I want to do, when I click OK, I have just created the building block.
I am going to test it out now by creating another new blank document. We go to the top left corner, select New > Blank Document and Create. Now I want that cover page. I can quickly go to my Insert tab, Quick Parts, down to my Building Blocks Organizer, because in Cover Pages here, you are going to see My Custom, and I'm going to just stretch this out, so you can see My Custom cover page. There is a preview, and when I click Insert, that gets inserted. It says Type Document Title Here. So I click here, I'm going to type in, Dave's big book, and then when I click on the page itself, I have replaced the code with text.
I was able to use a field code to create that prompt to have me type in the title. It's a great way to create templates, as well as what we just did here which is building block for a cover page. So, there are tons of field codes to choose from built-in to Word 2007. You access them many different ways. Of course you can access all the field codes by going to the Quick Parts dropdown up here and going to Field Code, but you can also create your own. That's the important thing, modify existing field codes, create your own, such as the one we just did here, it will save you a lot of time, a lot of effort, especially when you are working with long documents.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.