How to Learn New Word Every Day by Adding a “Word of the Day” Feature in Your Word

In this article, we will show you how to add a “Word of the Day” feature in your Word as to learn new word every day.

“Word of the Day” is a common feature of many online dictionaries. Then wouldn’t it a better thing that you can learn new words each time you starting Word? Today, we will zero in on showing how to achieve so.Word of the Day

Create an Excel File First

The first thing you need do is to create an Excel file, with all the following requirements met.

  1. Firstly, start Excel. Enter “Number” in cell A1, “Word” in cell B1, and “Times” in cell C1.
  2. Secondly, fill the first column with serial numbers.
  3. Thirdly, input all words you want to learn in the second column.
  4. And type “0” (number) in the third column.
  5. Next select the third column by clicking on letter “C”.
  6. Right click and choose “Format Cells”.Right Click and Choose "Format Cells"
  7. In “Format Cells” box, under “Number” tab and select “Number” for category.
  8. Then choose “0” for decimal places and click “OK”.Select "Number" under "Number" Tab->Choose "0" for "Decimal places"->Click "OK"
  9. Next rename the worksheet as “Words”.
  10. Finally, save and name the Excel file as “Word of the Day”.Create an Excel File

In our case, we save the file under the following folder:

 

C:\Users\Public\Documents\Sample

 

You can click here to download a sample file.

Alter and Save Codes in Word VBA

  1. First and foremost, open Word and press “Alt+ F11” to trigger VBA editor.
  2. Next click “Normal” and then “Insert” on toolbar.
  3. Choose “Module” on the drop-down menu of “Insert”.Click "Normal"->Click "Insert"->Click "Module"
  4. Double click module to open it and paste the following codes there:
Sub AutoExec()
  Dim objExcel As Excel.Application
  Dim objWorkbook As Excel.Workbook
  Dim objWorksheet As Excel.Worksheet
  Dim nIndex As Integer
  Dim nMinValue As Integer
  Dim nMinIndex As Integer
 
  Set objExcel = CreateObject("Excel.Application")
  Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Public\Documents\Sample\Word of the Day.xlsx")
  Set objWorksheet = objWorkbook.Sheets("Words")
 
  ' Initialization
  nMinValue = 0
  nMinIndex = -1
 
  For nIndex = 2 To objWorksheet.UsedRange.Rows.Count
    If (nMinIndex = -1) Then
      nMinValue = objWorksheet.Cells(nIndex, 3).Value
      nMinIndex = nIndex
    Else
      If (objWorksheet.Cells(nIndex, 3).Value < nMinValue) Then
        nMinValue = objWorksheet.Cells(nIndex, 3).Value
        nMinIndex = nIndex
      End If
    End If
  Next nIndex
 
  frmWordOfTheDay.txtWordOfTheDay.text = objWorksheet.Cells(nMinIndex, 2).Value
  frmWordOfTheDay.txtWordOfTheDay.Font.Size = 12
  frmWordOfTheDay.Show Modal
 
  objWorksheet.Cells(nMinIndex, 3).Value = objWorksheet.Cells(nMinIndex, 3).Value + 1
 
  objWorkbook.Close SaveChanges:=True
  ' Close Excel with the Quit method on the Application object.
  objExcel.Application.Quit
  ' Release the object variable.
  Set objExcel = Nothing
End Sub
  1. Click “Save” to save codes.

Note

Find this code line:

Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Public\Documents\Sample\Word of the Day.xlsx")

Replace the path with your own one.

Create a User Form in Word

Since running the macro shall return a word with its meanings and usage example, it would be more user-friendly to create a user form instead of a message box.

  1. After you save codes in module, click “Insert” again and choose “UserForm” this time.
  2. Now you will get a user form. Click on handles around the form to adjust its size.
  3. Next click “View” on toolbar and select “Toolbox” to bring it out.Click "View"->Choose "Toolbox"
  4. Click “Properties Window” on toolbar or press “F4” to have it open at down-left corner. Adjust its size as need.
  5. In the first column of the property window, find “Name” and “Caption”. And enter name and description you like in the second column respectively. For example, we set the form name as “frmWordOfTheDay”, and enter “Word of the Day” for caption.Enter Name and Caption for User Form
  6. Next in the toolbox, click the “Label” button with letter A on it.
  7. Use cursor to drag a label of proper size.
  8. Similarly, set the label name, caption, font and fore color in the property window.Click Label in Toolbox->Adjust Label Size->Set Label Name Caption Font and Fore Color
  9. Next add a text box and command button to the form, and set their properties as well. Remember to set “MultiLine” as “True” if you text cover several lines. Here we name the text box as “txtWordOftheDay”.Add Text Box and Command Button->Set Properties
  10. Double click on “Close” to open coding area. And enter “Unload Me”, such as bellow:Enter Codes for Close Event
  11. Now go back to the “AutoExec” macro, and fins the following code lines:
frmWordOfTheDay.txtWordOfTheDay.text = objWorksheet.Cells(nMinIndex, 2).Value

frmWordOfTheDay.txtWordOfTheDay.Font.Size = 12

frmWordOfTheDay.Show Modal

Among them, the “frmWordOfTheDay” is the name of the user form, and “txtWordOfTheDay” is the name of text box. Therefore, replace them with the names you actually use.

In the future, every time you start Word, you shall see a user form, showing you the word of the day. You can close it by clicking “Close”.User Form Showing Word of the Day

Carefully Handle Your Word Document

Since Word is vulnerable to errors, your documents become the number one victim. Thus, you must handle carefully with documents, especially when they get corrupt. At that time, you shall get a qualified Word recovery tool.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including damaged xls and pdf repair software products. For more information visit www.datanumen.com

Comments are closed.