Changing the Default Document Format

19:08 |
Normally, Word saves your documents in what is known as "Word format." In Word 2007 and Word 2010 that means that the documents are stored in a format based on XML. This format may not be easily understood by other versions of Word, nor by other programs.

If you do a lot of work creating documents for other versions of Word or other programs, you may want to specify a different default file format for your documents. Word makes this easy by following these steps:

- Display the Word Options dialog box. (In Word 2007 click the Office button and then click Word Options. In Word 2010 display the File tab of the ribbon and then click Options.)

- Click the Save option at the left side of the dialog box. (See Figure 1.)


Figure 1. The Save option of the Word Options dialog box.

- Use the Save Files In This Format drop-down list to select a default file format.

- Click on OK.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip applies to Microsoft Word 2007 and 2010.

Auto Creation of an Acronym List

19:04 |
You work in a profession that uses a lot of acronyms . Their standard procedure is to define the acronym the first time it is only used in the document . Also, you always need to create an appendix at the end of the document, a list of acronyms in alphabetical order along with their meanings . Karl was looking for a way to "mark " the acronym for the main part and appendix of acronyms are automatically generated .

There is no way to do this directly in Word . There are several types of tables you can create automatic , such as the table of contents , table of authorities , and indexing . Two final table ( table of authorities and index ) can be used to create a list of acronyms , but only if you are not already added to your document and only if you do not remember the list of acronyms you include page numbers .

If you want to use the index tool in order to create your list, you can follow these general steps, assuming that the acronym, when defined, is followed by its meaning within parentheses:

- Select the acronym and its meaning. This means that you find the first instance of the acronym in your document and then select that acronym along with the parenthetical meaning that follows it.

- Press Alt+Shift+X to mark the selected text for the index.

- Repeat steps 1 and 2 for the other acronyms you want in your list.

- At the end of your document, insert your index. How to actually insert an index has been covered in other issues of WordTips.

You'll note that this approach leaves the parentheses in your index. If you don't want the parentheses, then you'll need to go to each acronym that you marked and display the field code used for the index. It will look something like this:

{ XE "abbrev (this is the definition)" }

Within the field code you can remove the parentheses so that the text appears just as you want it to appear in the acronym list. If you use the above method to mark only the first instance of the acronym—where it is first defined—then there will be a single page number for each acronym in your list. If you like the idea of having page numbers, but want them for all instances of each acronym, then you'll need to mark each occurrence of the acronyms—a much more involved task.

If you prefer not to use the either of the methods already described, you could create a macro that will aid you in creating your acronym list. The following macro essentially copies whatever text you have highlighted to the end of the document.

Sub Send_2_acronym_list()
    With ActiveDocument.Bookmarks
        .Add Range:=Selection.Range, Name:="xxxHERExxx"
        .DefaultSorting = wdSortByName
        .ShowHidden = True
    End With
    Selection.Copy
    Selection.EndKey Unit:=wdStory
    Selection.TypeParagraph
    Selection.PasteAndFormat (wdPasteDefault)
    Selection.GoTo What:=wdGoToBookmark, Name:="xxxHERExxx"
    Application.Run MacroName:="Normal.MoreNewMacros.EditGoTo"
    Selection.MoveRight Unit:=wdCharacter, Count:=1
End Sub

The idea is to select your first instance of the acronym, along with its definition, and then invoke the macro. A bookmark is set at the current location, the text is copied, the end of the document is selected, and the text added there. Then the bookmark is used so that the original location can again be selected.

When you are done "marking" your acronyms in this manner, you can select the text that was copied to the end of the document and format it (or edit it) in any way desired.

If you want an approach that is even more automated, then you may be able to create a macro that will scan through your document and extract any acronyms it finds. In order for an approach like this to work, you'll need to make sure that you religiously follow a rigid structure for your acronyms and their definitions. The following macro assumes that the acronym will always be a string of uppercase letters followed by a space and then some parenthetical text.

Sub ListAcronyms()
    Dim strAcronym As String
    Dim strDefine As String
    Dim strOutput As String
    Dim newDoc As Document

    Application.ScreenUpdating = False
    Selection.HomeKey Unit:=wdStory
    ActiveWindow.View.ShowHiddenText = False

   'Loop to find all acronyms
    Do
        'Search for acronyms using wildcards
        Selection.Find.ClearFormatting
        With Selection.Find
            .ClearFormatting
            .Text = "<[A-Z]@[A-Z]>"
            .Replacement.Text = ""
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchCase = True
            .MatchWildcards = True
            .MatchWholeWord = True
            .Execute
        End With

        'Only process if something found
        If Selection.Find.Found Then
            'Make a string from the selection, add it to the
            'output string
            strAcronym = Selection.Text

            'Look for definition
            Selection.MoveRight Unit:=wdWord
            Selection.MoveRight Unit:=wdCharacter, _
              Extend:=wdExtend
            strDefine = ""
            If Selection.Text = "(" Then
                While Selection <> ")"
                    strDefine = strDefine & Selection.Text
                    Selection.Collapse Direction:=wdCollapseEnd
                    Selection.MoveRight Unit:=wdCharacter, _
                      Extend:=wdExtend
                Wend
            End If
            Selection.Collapse Direction:=wdCollapseEnd
            If Left(strDefine, 1) = "(" Then
                strDefine = Mid(strDefine, 2, Len(strDefine))
            End If
            If strDefine > "" Then
                'Check if the search result is in the Output string
                'if it is, ignore the search result
                If InStr(strOutput, strAcronym) = 0 Then
                    strOutput = strOutput & strAcronym _
                      & vbTab & strDefine & vbCr
                End If
            End If
        End If
    Loop Until Not Selection.Find.Found

    'Create new document and change active document
    Set newDoc = Documents.Add

    'Insert the text
    Selection.TypeText Text:=strOutput

    'Sort it
    newDoc.Content.Sort SortOrder:=wdSortOrderAscending
    Application.ScreenUpdating = True
    Selection.HomeKey Unit:=wdStory
End Sub

The macro looks through the document for anything it thinks might be an acronym. If it finds a candidate, it looks after it to see if it is followed by an opening parenthesis. If so, then everything up to the closing parenthesis is considered the definition for the acronym. Once the macro is finished going through the document, it creates a new document, adds the acronyms there, and then sorts them all.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip applies to Microsoft Word 2007 and 2010.

Adding Individual Styles to the Template

18:58 |
Templates are used in Word to define how you want your menus, toolbar, glossary, and default styles to appear. When you are either adding new styles or changing existing styles, Word allows you to update the template to reflect those style changes. To do this, follow these steps:

Make sure the Home tab of the ribbon is displayed.

Click the small arrow at the bottom-right corner of the Styles group. The Styles pane appears at the right of the program window.

In the Styles pane, scroll through the list of styles until you see the style you want to change.

Move the mouse pointer over the style name and then click on the down-arrow at the right side of the style name.

Click on Modify. The Modify Style dialog box appears. (See Figure 1.)


Figure 1. The Modify Style dialog box.

Make sure the New Documents Based On This Template radio button is selected.

Make any changes to the style you desire.

Click on OK.

To add or update other styles in the template file, repeat steps 3 through 8.

When you have finished changing styles, close the Styles pane.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip applies to Microsoft Word 2007, 2010, and 2013. 

Adding Table Columns to Columns with Merged Cells

18:55 |
You have a table in which the cells on top of two adjacent columns are merged . If he position the insertion point in the first cell of the column adjacent ( but not in merged cells ) , and then insert a column to the right of the insertion point . From seriously adds a column , but also adds a checkbox to the right of the merged cells .

This is normal behavior for Word . Let's say your table consists of three columns , which we will call A , B , and C. If you combine the first row cells in column A and B , you now have two cells ( one large and one small ) in the first row and three cells in every other row . Position the insertion point in a column A cell that is not first , merged row and insert a column to the right and you discover that Word adds a new column B and push the other columns ( B and C old old ) the right. This means that Word can add a cell to the right of the merged cells ( in new column C ) , the first customers will be incorrect . A first row with three cells ( one large and two small ) and the other with four rows of cells - just like you so what you end up with after the insertion .

The problem comes in when to your table all the cells in the first row merged . For example , you can have a table that has two columns and two cells in the first row are merged into a single cell . When you insert a column to the right of the first column , Word adds a cell to the right of the first merged cell . What you can expect , however , that Word will insert columns without affecting the merged cells , such that the single merged cell will now spans three columns instead of two.

There is no way to do this when doing a simple insert columns . There are a few things you can try , however . Another method is to split the merged cell at the top , insert the desired column , and then merge three cells into one.

You can also go ahead and insert the column as described . Then select the cells merged old and new cells are added in the first row and merge them .

Another method is to separate the rows merged with the rest of the table by splitting the table . Then you can insert the desired columns and tables combined share previously . Of course , then you will need to expand the width of your merged cells so that it fully covers three columns below it .

Finally , you can insert cells instead of inserting columns . Assuming that your table has two columns of ten rows , follow these steps :

- Select the cells in the second column is in row two to ten . ( You can not select the merged cell in the top at all . )

- Display the Layout tab of the ribbon.

- Click the small icon in the bottom right corner of the Rows & Columns group . Word displays the Insert dialog box cells . ( See Figure 1 ) .


Hình 1. Các tế bào hộp thoại Insert.

- Hãy chắc chắn rằng các tế bào Dịch phải nút tùy chọn được chọn.

- Nhấn OK.

Từ chuyển các tế bào chọn theo bên phải và chèn các ô trống. Hàng đầu vẫn không thay đổi, với các tế bào bị sáp nhập vẫn còn kéo dài các cột đầu tiên và thứ hai. Nếu bạn muốn các tế bào bị sáp nhập để mở rộng tất cả ba cột, bạn sẽ cần phải kéo biên giới di động vì vậy nó là chiều rộng mong muốn.

WordTips là nguồn cung cấp đào tạo Microsoft Word hiệu quả chi phí. (Microsoft Word là phần mềm xử lý văn bản phổ biến nhất trên thế giới.) Mẹo này áp dụng cho Microsoft Word 2007 và 2010.

Alphabetizing By Last Name

18:51 |
It is not unusual to have a list of names in a document, and then need to sort those names. The format in which the names appear can be bothersome, however. For instance, if the names are in the order FIRST LAST, then it can be more challenging to sort them than if they are in a LAST, FIRST order. There are several ways you can accomplish the task, however. One way is with the use of tables. All you need to do is follow these general steps:

1.Convert the text to a table, using the space between the first and last names as a separator between columns.

2. Sort the names based upon the second column, which contains the last name.

3. Convert the table back into text.

This process might sound difficult, but it can go very quickly and allows you to easily see what Word is doing during the sorting.

Another approach that doesn't require messing around with tables is to simply sort the text by words. You can do that by following these steps:

- Make sure the names in your document are arranged so there is only one person per paragraph.

- Select all the paragraphs containing names.

- Make sure the Home tab of the ribbon is displayed.

- Click the Sort tool in the Paragraph group. Word displays the Sort Text dialog box. (See Figure 1.)


Figure 1. The Sort Text dialog box.

- Click on Options. Word displays the Sort Options dialog box. (See Figure 2.)


Figure 2. The Sort Options dialog box.

- Select the Other option.

- Erase whatever is in the box to the right of Other, replacing it with a single space. (You are telling Word that you want to consider spaces as the dividing point between sort fields.)

- Click on OK to close the Sort Options dialog box.

- Use the Sort By drop-down lists to specify the word by which you want to sort. For instance, if you want to sort by last name (the word after the first space), you should choose Word 2 in the Sort By drop-down list.

- Click on OK to sort your names.

You should note that this approach only works properly depending on the construction of the names in your list. If there is only a first and last name for each person, then the sorting works fine. It will also work fine if there is a first, middle, and last name for each person—the only difference is that you would select Word 3 in step 8. Problems creep in, however, if there are two names for some people and three for others. In those instances, even the convert-to-table approach first mentioned will not work properly. In that case you must do something to make sure that Word treats first and middle names as if they are a single word; for instance, by separating them with a non-breaking space.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip applies to Microsoft Word 2007, 2010, and 2013.

Controlling the Format of Cross-References

18:47 |
Stephen asked if it is possible to control the format of cross-references inserted by Word. When he inserts a label and number such as Table 1 or Figure 12, he wants the label lowercase (table, figure) and a non-breaking space between the label and the number.

There is no way to control this type of cross-reference formatting in Word. Obviously you can change the cross-references manually after placing them, but whenever you update fields the original Word-chosen format will be used for them. There are a couple of macro-based solutions you can try. The first solution will change the actual field codes used for the field:

Sub FieldRefChanges1()
    On Error Resume Next
    Dim oStoryRng As Range
    Dim oFld As Field

    For Each oStoryRng In ActiveDocument.StoryRanges
        For Each oFld In oStoryRng.Fields
            If oFld.Type = wdFieldRef And oFld.Result.Words.Count <= 2 Then
                'add format switch with lowercase option to field codes
                oFld.Code.Text = oFld.Code.Text & "\* lower "
                'updates the field results to display the new format
                oFld.Update
            End If
        Next oFld
    Next oStoryRng
End Sub

The macro includes a couple of nested For loops. The first one steps through each story in the document, and the second goes through each field in each story. An If statement is then used to make sure that the field is a REF field (the kind used for cross-references) and that the result of the field is two or fewer words (as in Table 1 or Figure 12).

If these criteria are met, then the macro makes a change to the actual field code, adding the switch that results in the field being displayed in lowercase.

There are a couple of drawbacks to this macro. First, if you run it multiple times, the \* lower switch is added to the REF fields multiple times. Second, the macro doesn't change the space in the field results to a non-breaking space.

To overcome both problems, just modify the macro so that it automates the manual process you would go through to change the macro results.

Sub FieldRefChanges2()
    On Error Resume Next
    Dim oStoryRng As Range
    Dim oFld As Field
    Dim sTemp As String
    Dim J As String

    For Each oStoryRng In ActiveDocument.StoryRanges
        For Each oFld In oStoryRng.Fields
            If oFld.Type = wdFieldRef And oFld.Result.Words.Count <= 2 Then
                sTemp = oFld.Result.Text
                sTemp = LCase(sTemp)
                J = InStr(sTemp, " ")
                sTemp = Left(sTemp, J - 1) & Chr(160) & _
                  Mid(sTemp, J + 1, Len(sTemp) - J)
                oFld.Result.Text = sTemp
            End If
        Next oFld
    Next oStoryRng
End Sub

This macro is essentially the same as the previous one, except that it works strictly with the result text for the field. The text is assigned to the sTemp variable, which is then converted to lowercase. The position of the space is determined, and it is replaced with a non-breaking space. The result is then stuffed back into the result text for the field.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip applies to Microsoft Word 2007 and 2010.
Được tạo bởi Blogger.

Tìm Kiếm

diaocphatdat