End of word document with

ms-word-how-to-go-end-doc

There are two ways you can go to the end of a Word document. The first is to use a keyboard shortcut and the second is to create a macro. There are pros and cons of each approach. Here’s how to do it.

How to go to the end of a Microsoft Word document automatically

Using Keyboard – Go to end of MS Word document

If you want to go directly to the end of a Word document when its opens:

Press Ctrl+End

This takes you to the very last character in the document.

If you want to go back to the start of the document:

Press Ctrl+Home

Using Macros – Go to end of MS Word document

You can also setup a macro to do this.

To create a macro, add the following lines of code in the Autoopen macro:

Sub AutoOpen()
Selection.EndKey Unit:=wdStory
End Sub

Which is better?

If you simply want to go to the end of the document, then use Ctrl+End.

However, if you want to run several macros at the same time, for example, to change fonts, format the document and so on, then use the macro to bring you to the end of the document when it’s finished processing.

Does this work on your keyboard? What other shortcuts do you use in Microsoft Word?

Please Note:
This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Jumping to the Start or End of a Document.

Written by Allen Wyatt (last updated September 20, 2021)
This tip applies to Word 97, 2000, 2002, and 2003


When you are creating a macro, there are many times you want to move to the beginning or end of your document. The exact syntax for how you do this depends on whether you are using WordBasic or VBA. If you are programming in VBA, you use the HomeKey and EndKey methods of the Selection object. For instance, the following two lines will move the cursor to the beginning of the document, and then to the end:

Selection.HomeKey Unit:=wdStory
Selection.EndKey Unit:=wdStory

If you want to select everything from the current position to the beginning or end of the document, you simply add the Extend method. The following will select everything from the current location to the beginning of the document:

Selection.HomeKey Unit:=wdStory, Extend:=wdExtend

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I’ve prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training.
(Microsoft Word is the most popular word processing software in the world.)
This tip (120) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Jumping to the Start or End of a Document.

Author Bio

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. Learn more about Allen…

MORE FROM ALLEN

Cross-referencing to an Automatic Number

Word allows you to add automatic numbering to different elements of your document, such as to headings. If you want to …

Discover More

Generating Random Testing Data

Need to test your formulas? Then you need some testing data that you can use to see if the formulas function as you …

Discover More

Replacing with Plain Text

When using Find and Replace, how your replacements are formatted will depend on how the text being replaced is formatted. …

Discover More

More WordTips (menu)

Determining if a Text Selection Exists

Macros are often designed to be run on just a selected portion of a document. It is a good idea to make sure that the …

Discover More

Determining the Size of a File

When processing a document using a macro, you may need to know the precise size of a particular file. The way you figure …

Discover More

Turning Off Screen Updating

When working with macros, you can often speed up processing by turning off the updating of the screen. Best news is that …

Discover More

aski4

0 / 0 / 0

Регистрация: 05.05.2020

Сообщений: 2

1

Как правильно определить конец документа для работы с ним?

05.05.2020, 12:50. Показов 3982. Ответов 3

Метки vba word (Все метки)


Студворк — интернет-сервис помощи студентам

Сразу два вопроса:

1) Была тут тема Как определить конец документа в Word?. Пытался подробным способом выделить и удалить последнюю страницу.

C#
1
2
3
doc.Application.Selection.GoTo(1, ref oMissing, page_nmb, "");
doc.Range(doc.Application.Selection.Start, doc.Application.Selection.Expand(Microsoft.Office.Interop.Word.WdUnits.wdStory)).Select();
doc.Application.Selection.Delete();

(Извиняюсь что код на шарпе, а не vba, не думаю что это сильно влияет на суть вопроса. Ответ приветствуется на любом языке.)
Таким способом последняя страница на которой абзац начинается в начале страницы — удаляется нормально. Если же абзац переходит с предыдущей страницы, содержимое последней страницы удаляется, а пустая страница остается. Как удалить страницу полностью?

2) Примерно таким же способом пытаюсь перейти на конец документа и добавить пустую страницу

C#
1
2
3
4
5
doc.Application.Selection.GoTo(1, ref oMissing, page_nmb, "");
//doc.Application.Selection.EndOf(Microsoft.Office.Interop.Word.WdUnits.wdStory, Microsoft.Office.Interop.Word.WdMovementType.wdMove);
//doc.Application.Selection.MoveEnd(Microsoft.Office.Interop.Word.WdUnits.wdStory);
doc.Application.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory, Microsoft.Office.Interop.Word.WdMovementType.wdMove);
doc.Application.Selection.InsertBreak(Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak);

Добавляется две пустых страницы вместо одной. Как правильно добавить одну страницу в конец документа?



0



amd48

779 / 461 / 79

Регистрация: 18.05.2016

Сообщений: 1,242

Записей в блоге: 4

06.05.2020, 07:33

2

не совсем понятно, что именно надо получить. количество листов в документе?
есть просто параметр документа:

Visual Basic
1
MsgBox ActiveDocument.Content.Information(wdActiveEndAdjustedPageNumber)

или, если у вас приложуха Word запущена, то почему просто не перейти к концу документа?

Visual Basic
1
2
Selection.EndKey Unit:=wdStory
MsgBox Selection.Information(wdActiveEndPageNumber)

Добавлено через 7 минут
2. пустая страница добавляется так:

Visual Basic
1
Selection.InsertNewPage

а вы добавляете разрыв страницы InsertBreak



1



aski4

0 / 0 / 0

Регистрация: 05.05.2020

Сообщений: 2

06.05.2020, 09:35

 [ТС]

3

amd48

2. пустая страница добавляется так:

PureBasic
1
Selection.InsertNewPage

Такая вставка новой страницы работает, спасибо.

Количество страниц, не совсем то что мне нужно определить, для определения количества я использую:

C#
1
doc.ActiveWindow.ActivePane.Pages.Count;

Остался вопрос: как удалить последнюю страницу со всем содержимым?



0



amd48

779 / 461 / 79

Регистрация: 18.05.2016

Сообщений: 1,242

Записей в блоге: 4

06.05.2020, 13:36

4

Цитата
Сообщение от aski4
Посмотреть сообщение

как удалить последнюю страницу со всем содержимым?

Ну удаляется не страница, а текст. Если страница добавлена разрывом страниц, то это символ разрыва.
как-то так:

Visual Basic
1
2
3
4
5
6
7
8
    Selection.EndKey Unit:=wdStory                      'переходим в конец документа
    With Selection.Find
        .Text = "^m"                                    'ищем символ разрыва страницы
        .Forward = False                                'отсюда и назад. т.е. последний в документе
    End With
    Selection.Find.Execute
    Selection.EndKey Unit:=wdStory, Extend:=wdExtend    'выделяем отсюда и до конца
    Selection.Delete                                    'удаляем

Добавлено через 8 минут
Да. И особенность разрыва в том, что он находится на предыдущей странице. А если их в документе несколько? Можно после поиска добавить проверку: если курсор на предпоследнем листе (количество листов минус 1), то это тот самый разрыв — можно удалить



0



All hotkeys for Microsoft Word 2007 (Windows)

Common tasks
Create a Nonbreaking Space

Ctrl + Shift + Space

Common tasks
Create a Nonbreaking Hyphen

Ctrl + - (Hyphen)

Common tasks
Make letters BOLD

Ctrl + B

Common tasks
Make letters ITALIC

Ctrl + I

Common tasks
Make letters UNDERLINED

Ctrl + U

Common tasks
Decrease font size one value

Ctrl + Shift + <

Common tasks
Increase font size one value

Ctrl + Shift + >

Common tasks
Increase the font size by 1 point.

Ctrl + [

Common tasks
Decrease the font size by 1 point.

Ctrl + ]

Common tasks
Remove paragraph or character formatting.

Ctrl + Space

Common tasks
Copy the selected text or object.

Ctrl + C

Common tasks
Cut the selected text or object.

Ctrl + X

Common tasks
Paste text or an object.

Ctrl + V

Common tasks
Paste special

Ctrl + Alt + V

Common tasks
Paste formatting only

Ctrl + Shift + V

Common tasks
Undo the last action.

Ctrl + Z

Common tasks
Redo the last action.

Ctrl + Y

Common tasks
Open the Word Count dialog box.

Ctrl + Shift + G

Working with documents: Create, view, and save documents
Create a new document of the same type as the current or most recent document.

Ctrl + N

Working with documents: Create, view, and save documents
Open a document.

Ctrl + O

Working with documents: Create, view, and save documents
Close a document.

Ctrl + W

Working with documents: Create, view, and save documents
Split the document window.

Alt + Ctrl + S

Working with documents: Create, view, and save documents
Remove the document window split.

Alt + Shift + C

Working with documents: Create, view, and save documents
Save a document.

Ctrl + S

Working with documents: Create, view, and save documents
Create a new document of the same type as the current or most recent document.

Ctrl + N

Working with documents: Create, view, and save documents
Open a document.

Ctrl + O

Working with documents: Create, view, and save documents
Close a document.

Ctrl + W

Working with documents: Create, view, and save documents
Split the document window.

Alt + Ctrl + S

Working with documents: Create, view, and save documents
Remove the document window split.

Alt + Shift + C

Working with documents: Create, view, and save documents
Save a document.

Ctrl + S

Working with documents: Create, view, and save documents
Create a new document of the same type as the current or most recent document.

Ctrl + N

Working with documents: Create, view, and save documents
Open a document.

Ctrl + O

Working with documents: Create, view, and save documents
Close a document.

Ctrl + W

Working with documents: Create, view, and save documents
Split the document window.

Alt + Ctrl + S

Working with documents: Create, view, and save documents
Remove the document window split.

Alt + Shift + C

Working with documents: Create, view, and save documents
Save a document.

Ctrl + S

Working with documents: Find, replace, and browse through text
Find text, formatting, and special items.

Ctrl + F

Working with documents: Find, replace, and browse through text
Repeat find (after closing Find and Replace window).

Alt + Ctrl + Y

Working with documents: Find, replace, and browse through text
Replace text, specific formatting, and special items.

Ctrl + H

Working with documents: Find, replace, and browse through text
Go to a page, bookmark, footnote, table, comment, graphic, or other location.

Ctrl + G

Working with documents: Find, replace, and browse through text
Switch between the last four places that you have edited.

Alt + Ctrl + Z

Working with documents: Find, replace, and browse through text
Open a list of browse options. Press the arrow keys to select an option, and then press ENTER to browse through a document by using the selected option.

Alt + Ctrl + Home

Working with documents: Switch to another view
Move to the previous edit location.

Ctrl + Page Up

Working with documents: Switch to another view
Move to the next edit location.

Ctrl + Page Down

Working with documents: Switch to another view
Switch to Print Layout view.

Alt + Ctrl + P

Working with documents: Switch to another view
Switch to Outline view.

Alt + Ctrl + O

Working with documents: Switch to another view
Switch to Draft view.

Alt + Ctrl + N

Working with documents: Outline view
Promote a paragraph.

Alt + Shift + Arrow Left

Working with documents: Outline view
Demote a paragraph.

Alt + Shift + Arrow Right

Working with documents: Outline view
Demote to body text.

Ctrl + Shift + N

Working with documents: Outline view
Move selected paragraphs up.

Alt + Shift + Arrow Up

Working with documents: Outline view
Move selected paragraphs down.

Alt + Shift + Arrow Down

Working with documents: Outline view
Expand text under a heading.

Alt + Shift + [ + (Plus Sign)

Working with documents: Outline view
Collapse text under a heading.

Alt + Shift + - (Minus Sign)

Working with documents: Outline view
Expand or collapse all text or headings.

Alt + Shift + A

Working with documents: Outline view
Hide or display character formatting.

The slash ( / ) key on the numeric keypad

Working with documents: Outline view
Show the first line of body text or all body text.

Alt + Shift + L

Working with documents: Outline view
Show all headings with the Heading 1 style.

Alt + Shift + 1

Working with documents: Outline view
Show all headings up to Heading n.

Alt + Shift + N

Working with documents: Outline view
Insert a tab character.

Ctrl + Tab

Working with documents: Print and preview documents
Print a document.

Ctrl + P

Working with documents: Print and preview documents
Switch in or out of print preview.

Alt + Ctrl + I

Working with documents: Print and preview documents
Move around the preview page when zoomed in.

arrow up , arrow down , arrow left , arrow right

Working with documents: Print and preview documents
Move by one preview page when zoomed out.

Page Up / Page Down

Working with documents: Print and preview documents
Move to the first preview page when zoomed out.

Ctrl + Home

Working with documents: Print and preview documents
Move to the last preview page when zoomed out.

Ctrl + End

Working with documents: Review documents
Insert a comment.

Alt + Ctrl + M

Working with documents: Review documents
Turn change tracking on or off.

Ctrl + Shift + E

Working with documents: Review documents
Close the Reviewing Pane if it is open.

Alt + Shift + C

Working with documents: Full Screen Reading view
Go to beginning of document.

Home

Working with documents: Full Screen Reading view
Go to end of document.

End

Working with documents: Full Screen Reading view
Go to page n.

n, enter

Working with documents: Full Screen Reading view
Exit reading layout view.

Esc

Working with documents: References, footnotes, and endnotes
Mark a table of contents entry.

Alt + Shift + O

Working with documents: References, footnotes, and endnotes
Mark a table of authorities entry (citation).

Alt + Shift + I

Working with documents: References, footnotes, and endnotes
Mark an index entry.

Alt + Shift + X

Working with documents: References, footnotes, and endnotes
Insert a footnote.

Alt + Ctrl + F

Working with documents: References, footnotes, and endnotes
Insert an endnote.

Alt + Ctrl +

Working with documents: Work with Web pages
Insert a hyperlink.

Ctrl + K

Working with documents: Work with Web pages
Go back one page.

Alt + Arrow Left

Working with documents: Work with Web pages
Go forward one page.

Alt + Arrow Right

Working with documents: Work with Web pages
Refresh.

F9

Edit and move text and graphics: Delete text and graphics
Delete one character to the left.

Backspace

Edit and move text and graphics: Delete text and graphics
Delete one word to the left.

Ctrl + Backspace

Edit and move text and graphics: Delete text and graphics
Delete one character to the right.

Delete

Edit and move text and graphics: Delete text and graphics
Delete one word to the right.

Ctrl + Delete

Edit and move text and graphics: Delete text and graphics
Cut selected text to the Office Clipboard.

Ctrl + X

Edit and move text and graphics: Delete text and graphics
Undo the last action.

Ctrl + Z

Edit and move text and graphics: Delete text and graphics
Cut to the Spike.

Ctrl + F3

Edit and move text and graphics: Copy and move text and graphics
Open the Office Clipboard

Press alt + h to move to the home tab , and then press F,O.

Edit and move text and graphics: Copy and move text and graphics
Copy selected text or graphics to the Office Clipboard.

Ctrl + C

Edit and move text and graphics: Copy and move text and graphics
Cut selected text or graphics to the Office Clipboard.

Ctrl + X

Edit and move text and graphics: Copy and move text and graphics
Paste the most recent addition to the Office Clipboard.

Ctrl + V

Edit and move text and graphics: Copy and move text and graphics
Move text or graphics once.

f2 (then move the cursor and press enter )

Edit and move text and graphics: Copy and move text and graphics
Copy text or graphics once.

Shift + f2 (then move the cursor and press enter )

Edit and move text and graphics: Copy and move text and graphics
When text or an object is selected, open the Create New Building Block dialog box.

Alt + F3

Edit and move text and graphics: Copy and move text and graphics
When the building block — for example, a SmartArt graphic — is selected, display the shortcut menu that is associated with it.

Shift + f1 0

Edit and move text and graphics: Copy and move text and graphics
Cut to the Spike.

Ctrl + F3

Edit and move text and graphics: Copy and move text and graphics
Paste the Spike contents.

Ctrl + Shift + F3

Edit and move text and graphics: Copy and move text and graphics
Copy the header or footer used in the previous section of the document.

Alt + Shift + R

Edit and move text and graphics: Insert special characters
A field

Ctrl + F9

Edit and move text and graphics: Insert special characters
A line break

Shift + Enter

Edit and move text and graphics: Insert special characters
A page break

Ctrl + Enter

Edit and move text and graphics: Insert special characters
A column break

Ctrl + Shift + Enter

Edit and move text and graphics: Insert special characters
An em dash

Alt + Ctrl + - (Minus Sign)

Edit and move text and graphics: Insert special characters
An en dash

Ctrl + - (Minus Sign)

Edit and move text and graphics: Insert special characters
An optional hyphen

Ctrl + - (Hyphen)

Edit and move text and graphics: Insert special characters
A nonbreaking hyphen

Ctrl + Shift + - (Hyphen)

Edit and move text and graphics: Insert special characters
A nonbreaking space

Ctrl + Shift + Space

Edit and move text and graphics: Insert special characters
The copyright symbol

Alt + Ctrl + C

Edit and move text and graphics: Insert special characters
The registered trademark symbol

Alt + Ctrl + R

Edit and move text and graphics: Insert special characters
The trademark symbol

Alt + Ctrl + T

Edit and move text and graphics: Insert special characters
An ellipsis

Alt + Ctrl + . (Period)

Edit and move text and graphics: Insert special characters
An AutoText entry

enter (after you type the first few characters of the AutoText entry name and when the ScreenTip appears)

Edit and move text and graphics: Insert characters by using character codes
Insert the Unicode character for the specified Unicode (hexadecimal) character code. For example, to insert the euro currency symbol ( ), type 20AC, and then hold down ALT and press X.

The character code, alt + X

Edit and move text and graphics: Insert characters by using character codes
Find out the Unicode character code for the selected character

Alt + X

Edit and move text and graphics: Insert characters by using character codes
Insert the ANSI character for the specified ANSI (decimal) character code. For example, to insert the euro currency symbol, hold down ALT and press 0128 on the numeric keypad.

Alt + t he character code (on the numeric keypad)

Edit and move text and graphics: Extend a selection
Turn extend mode on.

F8

Edit and move text and graphics: Extend a selection
Select the nearest character.

f8 , and then press arrow left / Arrow Right

Edit and move text and graphics: Extend a selection
Increase the size of a selection.

f8 (press once to select a word, twice to select a sentence, and so on)

Edit and move text and graphics: Extend a selection
Reduce the size of a selection.

Shift + F8

Edit and move text and graphics: Extend a selection
Turn extend mode off.

Esc

Edit and move text and graphics: Extend a selection
Extend a selection one character to the right.

Shift + Arrow Right

Edit and move text and graphics: Extend a selection
Extend a selection one character to the left.

Shift + Arrow Left

Edit and move text and graphics: Extend a selection
Extend a selection to the end of a word.

Ctrl + Shift + Arrow Right

Edit and move text and graphics: Extend a selection
Extend a selection to the beginning of a word.

Ctrl + Shift + Arrow Left

Edit and move text and graphics: Extend a selection
Extend a selection to the end of a line.

Shift + End

Edit and move text and graphics: Extend a selection
Extend a selection to the beginning of a line.

Shift + Home

Edit and move text and graphics: Extend a selection
Extend a selection one line down.

Shift + Arrow Down

Edit and move text and graphics: Extend a selection
Extend a selection one line up.

Shift + Arrow Up

Edit and move text and graphics: Extend a selection
Extend a selection to the end of a paragraph.

Ctrl + Shift + Arrow Down

Edit and move text and graphics: Extend a selection
Extend a selection to the beginning of a paragraph.

Ctrl + Shift + Arrow Up

Edit and move text and graphics: Extend a selection
Extend a selection one screen down.

Shift + Page Down

Edit and move text and graphics: Extend a selection
Extend a selection one screen up.

Shift + Page Up

Edit and move text and graphics: Extend a selection
Extend a selection to the beginning of a document.

Ctrl + Shift + Home

Edit and move text and graphics: Extend a selection
Extend a selection to the end of a document.

Ctrl + Shift + End

Edit and move text and graphics: Extend a selection
Extend a selection to the end of a window.

Alt + Ctrl + Shift + Page Down

Edit and move text and graphics: Extend a selection
Extend a selection to include the entire document.

Ctrl + A

Edit and move text and graphics: Extend a selection
Select a vertical block of text.

Ctrl + Shift + f8 , and then use the arrow up , arrow down , arrow left , arrow right ; press esc to cancel selection mode

Edit and move text and graphics: Extend a selection
Extend a selection to a specific location in a document.

F8 + arrow up , arrow down , arrow left , arrow right ; press esc to cancel selection mode

Edit and move text and graphics: Select text and graphics in a table
Select the next cell’s contents.

Tab

Edit and move text and graphics: Select text and graphics in a table
Select the preceding cell’s contents.

Shift + Tab

Edit and move text and graphics: Select text and graphics in a table
Extend a selection to adjacent cells.

Hold down shift and press an arrow key repeatedly

Edit and move text and graphics: Select text and graphics in a table
Select a column.

Shift + Alt + page down with cursor in columns top cell

Edit and move text and graphics: Select text and graphics in a table
Select a column.

Shift + Alt + page up with cursor in columns top cell

Edit and move text and graphics: Select text and graphics in a table
Extend a selection (or block).

Ctrl + Shift + f8 , and then use the arrow up , arrow down , arrow left , arrow right ; press esc to cancel selection mode

Edit and move text and graphics: Select text and graphics in a table
Select an entire table.

Alt + 5 on the numeric keypad (with num lock off)

Edit and move text and graphics: Move through your document
One character to the left

Arrow Left

Edit and move text and graphics: Move through your document
One character to the right

Arrow Right

Edit and move text and graphics: Move through your document
One word to the left

Ctrl + Arrow Left

Edit and move text and graphics: Move through your document
One word to the right

Ctrl + Arrow Right

Edit and move text and graphics: Move through your document
One paragraph up

Ctrl + Arrow Up

Edit and move text and graphics: Move through your document
One paragraph down

Ctrl + Arrow Down

Edit and move text and graphics: Move through your document
One cell to the left (in a table)

Shift + Tab

Edit and move text and graphics: Move through your document
One cell to the right (in a table)

Tab

Edit and move text and graphics: Move through your document
Up one line

Arrow Up

Edit and move text and graphics: Move through your document
Down one line

Arrow Down

Edit and move text and graphics: Move through your document
To the end of a line

End

Edit and move text and graphics: Move through your document
To the beginning of a line

Home

Edit and move text and graphics: Move through your document
To the top of the window

Alt + Ctrl + Page Up

Edit and move text and graphics: Move through your document
To the end of the window

Alt + Ctrl + Page Down

Edit and move text and graphics: Move through your document
Up one screen (scrolling)

Page Up

Edit and move text and graphics: Move through your document
Down one screen (scrolling)

Page Down

Edit and move text and graphics: Move through your document
To the top of the next page

Ctrl + Page Down

Edit and move text and graphics: Move through your document
To the top of the previous page

Ctrl + Page Up

Edit and move text and graphics: Move through your document
To the end of a document

Ctrl + End

Edit and move text and graphics: Move through your document
To the beginning of a document

Ctrl + Home

Edit and move text and graphics: Move through your document
To a previous revision

Shift + F5

Edit and move text and graphics: Move through your document
After opening a document, to the location you were working in when the document was last closed

Shift + F5

Edit and move text and graphics: Move around in a table
To the next cell in a row

Tab

Edit and move text and graphics: Move around in a table
To the previous cell in a row

Shift + Tab

Edit and move text and graphics: Move around in a table
To the first cell in a row

Alt + Home

Edit and move text and graphics: Move around in a table
To the last cell in a row

Alt + End

Edit and move text and graphics: Move around in a table
To the first cell in a column

Alt + Page Up

Edit and move text and graphics: Move around in a table
To the last cell in a column

Alt + Page Down

Edit and move text and graphics: Move around in a table
To the previous row

Arrow Up

Edit and move text and graphics: Move around in a table
To the next row

Arrow Down

Edit and move text and graphics: Move around in a table
One row up

Alt + Shift + Arrow Up

Edit and move text and graphics: Move around in a table
One row down

Alt + Shift + Arrow Down

Edit and move text and graphics: Insert paragraphs and tab characters in a table
New paragraphs in a cell

Enter

Edit and move text and graphics: Insert paragraphs and tab characters in a table
Tab characters in a cell

Ctrl + Tab

Character and paragraph formatting Copy formatting
Copy formatting from text.

Ctrl + Shift + C

Character and paragraph formatting Copy formatting
Apply copied formatting to text.

Ctrl + Shift + V

Character and paragraph formatting Change or resize the font
Open the Font dialog box to change the font.

Ctrl + Shift + F

Character and paragraph formatting Change or resize the font
Decrease font size one value

Ctrl + Shift + <

Character and paragraph formatting Change or resize the font
Increase font size one value

Ctrl + Shift + >

Character and paragraph formatting Change or resize the font
Increase the font size by 1 point.

Ctrl + [

Character and paragraph formatting Change or resize the font
Decrease the font size by 1 point.

Ctrl + ]

Character and paragraph formatting Apply character formats
Open the Font dialog box to change the formatting of characters.

Ctrl + D

Character and paragraph formatting Apply character formats
Change the case of letters.

Shift + F3

Character and paragraph formatting Apply character formats
Format all letters as capitals.

Ctrl + Shift + A

Character and paragraph formatting Apply character formats
Apply bold formatting.

Ctrl + B

Character and paragraph formatting Apply character formats
Apply an underline.

Ctrl + U

Character and paragraph formatting Apply character formats
Underline words but not spaces.

Ctrl + Shift + W

Character and paragraph formatting Apply character formats
Double-underline text.

Ctrl + Shift + D

Character and paragraph formatting Apply character formats
Apply hidden text formatting.

Ctrl + Shift + H

Character and paragraph formatting Apply character formats
Apply italic formatting.

Ctrl + I

Character and paragraph formatting Apply character formats
Format letters as small capitals.

Ctrl + Shift + K

Character and paragraph formatting Apply character formats
Apply subscript formatting (automatic spacing).

Ctrl + =

Character and paragraph formatting Apply character formats
Apply superscript formatting (automatic spacing).

Ctrl + Shift + [ + (Plus Sign)

Character and paragraph formatting Apply character formats
Remove manual character formatting.

Ctrl + Space

Character and paragraph formatting Apply character formats
Change the selection to the Symbol font.

Ctrl + Shift + Q

Character and paragraph formatting View and copy text formats
Display nonprinting characters. * on numeric keyboard will not work

Ctrl + Shift + *

Character and paragraph formatting View and copy text formats
Review text formatting.

Shift + f1 (then click the text with the formatting you want to review)

Character and paragraph formatting View and copy text formats
Copy formats.

Ctrl + Shift + C

Character and paragraph formatting View and copy text formats
Paste formats.

Ctrl + Shift + V

Character and paragraph formatting Set the line spacing
Single-space lines.

Ctrl + 1

Character and paragraph formatting Set the line spacing
Double-space lines.

Ctrl + 2

Character and paragraph formatting Set the line spacing
Set 1.5-line spacing.

Ctrl + 5

Character and paragraph formatting Set the line spacing
Add or remove one line space preceding a paragraph.

Ctrl + 0 (zero)

Character and paragraph formatting Align paragraphs
Switch a paragraph between centered and left-aligned.

Ctrl + E

Character and paragraph formatting Align paragraphs
Switch a paragraph between justified and left-aligned.

Ctrl + J

Character and paragraph formatting Align paragraphs
Switch a paragraph between right-aligned and left-aligned.

Ctrl + R

Character and paragraph formatting Align paragraphs
Left align a paragraph.

Ctrl + L

Character and paragraph formatting Align paragraphs
Indent a paragraph from the left.

Ctrl + M

Character and paragraph formatting Align paragraphs
Remove a paragraph indent from the left.

Ctrl + Shift + M

Character and paragraph formatting Align paragraphs
Create a hanging indent.

Ctrl + T

Character and paragraph formatting Align paragraphs
Reduce a hanging indent.

Ctrl + Shift + T

Character and paragraph formatting Align paragraphs
Remove paragraph formatting.

Ctrl + Q

Character and paragraph formatting Apply paragraph styles
Open Apply Styles task pane.

Ctrl + Shift + S

Character and paragraph formatting Apply paragraph styles
Open Styles task pane.

Alt + Ctrl + Shift + S

Character and paragraph formatting Apply paragraph styles
Start AutoFormat.

Alt + Ctrl + K

Character and paragraph formatting Apply paragraph styles
Apply the Normal style.

Ctrl + Shift + N

Character and paragraph formatting Apply paragraph styles
Apply the Heading 1 style.

Alt + Ctrl + 1

Character and paragraph formatting Apply paragraph styles
Apply the Heading 2 style.

Alt + Ctrl + 2

Character and paragraph formatting Apply paragraph styles
Apply the Heading 3 style.

Alt + Ctrl + 3

Mail merge and fields: Perform a mail merge
Preview a mail merge.

Alt + Shift + K

Mail merge and fields: Perform a mail merge
Merge a document.

Alt + Shift + N

Mail merge and fields: Perform a mail merge
Print the merged document.

Alt + Shift + M

Mail merge and fields: Perform a mail merge
Edit a mail-merge data document.

Alt + Shift + E

Mail merge and fields: Perform a mail merge
Insert a merge field.

Alt + Shift + F

Mail merge and fields: Work with fields
Insert a DATE field.

Alt + Shift + D

Mail merge and fields: Work with fields
Insert a LISTNUM field.

Alt + Ctrl + L

Mail merge and fields: Work with fields
Insert a PAGE field.

Alt + Shift + P

Mail merge and fields: Work with fields
Insert a TIME field.

Alt + Shift + T

Mail merge and fields: Work with fields
Insert an empty field.

Ctrl + F9

Mail merge and fields: Work with fields
Update linked information in a Microsoft Office Word source document.

Ctrl + Shift + F7

Mail merge and fields: Work with fields
Update selected fields.

F9

Mail merge and fields: Work with fields
Unlink a field.

Ctrl + Shift + F9

Mail merge and fields: Work with fields
Switch between a selected field code and its result.

Shift + F9

Mail merge and fields: Work with fields
Switch between all field codes and their results.

Alt + F9

Mail merge and fields: Work with fields
Run GOTOBUTTON or MACROBUTTON from the field that displays the field results.

Alt + Shift + F9

Mail merge and fields: Work with fields
Go to the next field.

F11

Mail merge and fields: Work with fields
Go to the previous field.

Shift + F11

Mail merge and fields: Work with fields
Lock a field.

Ctrl + F11

Mail merge and fields: Work with fields
Unlock a field.

Ctrl + Shift + F11

Function key reference: Function keys
Get Help or visit Microsoft Office Online.

F1

Function key reference: Function keys
Move text or graphics.

F2

Function key reference: Function keys
Repeat the last action.

F4

Function key reference: Function keys
Choose the Go To command (Home tab).

F5

Function key reference: Function keys
Go to the next pane or frame.

F6

Function key reference: Function keys
Extend a selection.

F8

Function key reference: Function keys
Choose the Spelling command (Review tab).

F7

Function key reference: Function keys
Update the selected fields.

F9

Function key reference: Function keys
Show KeyTips.

F10

Function key reference: Function keys
Go to the next field.

F11

Function key reference: Function keys
Choose the Save As command (Microsoft Office Button ).

F12

Function key reference: SHIFT+Function key
Start context-sensitive Help or reveal formatting.

Shift + F1

Function key reference: SHIFT+Function key
Copy text.

Shift + F2

Function key reference: SHIFT+Function key
Change the case of letters.

Shift + F3

Function key reference: SHIFT+Function key
Repeat a Find or Go To action.

Shift + F4

Function key reference: SHIFT+Function key
Move to the last change.

Shift + F5

Function key reference: SHIFT+Function key
Go to the previous pane or frame (after pressing F6).

Shift + F6

Function key reference: SHIFT+Function key
Choose the Thesaurus command (Review tab, Proofing group).

Shift + F7

Function key reference: SHIFT+Function key
Shrink a selection.

Shift + F8

Function key reference: SHIFT+Function key
Switch between a field code and its result.

Shift + F9

Function key reference: SHIFT+Function key
Display a shortcut menu.

Shift + F10

Function key reference: SHIFT+Function key
Go to the previous field.

Shift + F11

Function key reference: SHIFT+Function key
Choose the Save command (Microsoft Office Button ).

Shift + F12

Function key reference: CTRL+Function key
Choose the Print Preview command (Microsoft Office Button ).

Ctrl + F2

Function key reference: CTRL+Function key
Cut to the Spike.

Ctrl + F3

Function key reference: CTRL+Function key
Close the window.

Ctrl + F4

Function key reference: CTRL+Function key
Go to the next window.

Ctrl + F6

Function key reference: CTRL+Function key
Insert an empty field.

Ctrl + F9

Function key reference: CTRL+Function key
Maximize the document window.

Ctrl + F10

Function key reference: CTRL+Function key
Lock a field.

Ctrl + F11

Function key reference: CTRL+Function key
Choose the Open command (Microsoft Office Button ).

Ctrl + F12

Function key reference: CTRL+SHIFT+Function key
Insert the contents of the Spike.

Ctrl + Shift + F3

Function key reference: CTRL+SHIFT+Function key
Edit a bookmark.

Ctrl + Shift + F5

Function key reference: CTRL+SHIFT+Function key
Go to the previous window.

Ctrl + Shift + F6

Function key reference: CTRL+SHIFT+Function key
Update linked information in an Office Word 2007 source document.

Ctrl + Shift + F7

Function key reference: CTRL+SHIFT+Function key
Extend a selection or block.

Ctrl + Shift + f8 , and arrow keys

Function key reference: CTRL+SHIFT+Function key
Unlink a field.

Ctrl + Shift + F9

Function key reference: CTRL+SHIFT+Function key
Unlock a field.

Ctrl + Shift + F11

Function key reference: CTRL+SHIFT+Function key
Choose the Print command (Microsoft Office Button ).

Ctrl + Shift + F12

Function key reference: ALT+Function key
Go to the next field.

Alt + F1

Function key reference: ALT+Function key
Create a new Building Block.

Alt + F3

Function key reference: ALT+Function key
Exit Office Word 2007.

Alt + F4

Function key reference: ALT+Function key
Restore the program window size.

Alt + F5

Function key reference: ALT+Function key
Move from an open dialog box back to the document, for dialog boxes such as Find and Replace that support this behavior.

Alt + F6

Function key reference: ALT+Function key
Find the next misspelling or grammatical error.

Alt + F7

Function key reference: ALT+Function key
Run a macro.

Alt + F8

Function key reference: ALT+Function key
Switch between all field codes and their results.

Alt + F9

Function key reference: ALT+Function key
Maximize the program window.

Alt + f10

Function key reference: ALT+Function key
Display Microsoft Visual Basic code.

Alt + F11

Function key reference: ALT+SHIFT+Function key
Go to the previous field.

Alt + Shift + F1

Function key reference: ALT+SHIFT+Function key
Choose the Save command (Microsoft Office Button ).

Alt + Shift + F2

Function key reference: ALT+SHIFT+Function key
Display the Research task pane.

Alt + Shift + F7

Function key reference: ALT+SHIFT+Function key
Run GOTOBUTTON or MACROBUTTON from the field that displays the field results.

Alt + Shift + F9

Function key reference: ALT+SHIFT+Function key
Display a menu or message for a smart tag.

Alt + Shift + F10

Function key reference: CTRL+ALT+Function key
Display Microsoft System Information.

Ctrl + Alt + F1

Function key reference: CTRL+ALT+Function key
Choose the Open command (Microsoft Office Button ).

Ctrl + Alt + F2

Similar combinations for other applications


Microsoft Projects 2010 (Windows)
Jump first cell / jump to last cell in row
Navigate Gantt Chart and Select Tasks

Home / End


Civilization V (Windows)
Capital City View
General Hotkeys

Home / End


Adobe Reader 9 (Linux)
Jump to beginning/ jump to end of document
Navigation

Home / End


Eclipse Helios (Windows)
Jump to beginning / jump to end of indention. Press home twice to jump to beginning of line
Navigate in Editor

Home / End


Eclipse Helios (Windows)
Jump to beginning / jump to end of source
Navigate in Editor

Ctrl + Home / End


Microsoft OneNote 2010 (Windows)
Move to the beginning / end of the line.
Basic Editing and Formatting

home / end


Microsoft Windows 7 (Windows)
Jump to first / jump to last item
Managing ‘Windows’ in Windows 7 — Navigate File List and Navigation Pane

Home / End


Microsoft Windows 7 (Windows)
Jump to beginning / jump to end of item name
Managing ‘Windows’ in Windows 7 — Navigate File List and Navigation Pane

F2 , then home / End


Thunderbird (Windows)
Go to first message / go to last message
Navigate Messages

Home / End


Remember the Milk (Web Application)
Pan map in direction indicated (larger step than arrow keys)
Locations

page up / page down ,
home / end


Adobe Photoshop CS5 (Windows)
Move to the beginning / to the end of the timeline
Photoshop CS5 Panels — Animation Panel (Timeline Mode, PS extended)

Home / End


Adobe Photoshop CS5 (MacOS)
Move to the beginning / to the end of the timeline
Photoshop CS5 Panels — Animation Panel (Timeline Mode, PS extended)

Home / End


Thunderbird (Linux)
Go to first message / go to last message
Navigate Messages

Home / End


Thunderbird (MacOS)
Go to first message / go to last message
Navigate Messages

Home / End


Adobe Photoshop CS4 (MacOS)
Go to last tile in Tile History (Pattern Maker only)
Shortcut Keys for working with Extract, Liquify, and Pattern Maker

End


Firefox (Linux)
Jump to beginning / end of webpage
Inside Webpages

Home / End


Firefox (Windows)
Jump to beginning / end of webpage
Inside Webpages

Home / End


Google Mail (Windows)
Jump to beginning of page / end of page
Control Main Browser Window (General Browser Shortcuts)

End / Home


Firefox (MacOS)
Go to Bottom of Page
Navigation Controls

End


Access 2010 (Windows)
Select first / select last command in menu
Manage Access Features — Menus

Home / End


Microsoft Outlook 2010 (Windows)
Go to beginning/end of current view
Messages in Main View — Navigate Calendar

Home / End


Access 2010 (Windows)
Move beginning / move to end of an entry
Manage Access Features — Text Boxes

Home / End


Inpage (Windows)
To go to the end of the line
To move cursor

End


Google Chrome (Windows)
Jump to beginning / to end of webpage
View Webpages

Home / End


Microsoft Windows 7 (Windows)
Jump to first / jump to last item
Windows Explorer — Navigate File List and Navigation Pane

Home / End


Microsoft Windows 7 (Windows)
Jump to beginning / jump to end of item name
Windows Explorer — Navigate File List and Navigation Pane

F2 , then home / End


Access 2010 (Windows)
Move cursor to the beginning / to the end of the field
Manage Access Features — Edit Text and Data

Home / End


VistaSwitcher (Windows)
Select a window from the list
Window List Selection

arrow keys or pageup / pagedown or home / End


Microsoft Excel 2010 (Windows)
Select the first item / last item in the AutoFilter list.
Work with Data Selections — Auto Filter

Home / End


Firefox (MacOS)
Forward to End
Media Control

End


Google Docs (Windows)
Jump to the end of a line / beginning of a line
Navigate Google Docs

End / Home


Access 2010 (Windows)
Move to first / move to last field in current record
Manage Access Features — Navigate in Datasheet, Subdatasheet, and Form View

Home / End


Google Chrome (Linux)
Jump to beginning / to end of webpage
View Webpages

Home / End


Google Docs (MacOS)
Jump to the end of a line / beginning of a line
Navigate Google Docs

End / Home


Access 2010 (Windows)
Go to the first cell / go to last cell in row
Manage Access Features — Database Diagram

Home / End


Mindjet Mindmanager 2012 (Windows)
Move topic top/bottom (remains on same level in hierarchy)
Most used — Move topics

Ctrl + Alt + Home / End


Adobe Photoshop CS5 (MacOS)
Go to last tile in Tile History
Photoshop CS5 Panels — Pattern Maker Only

End


Adobe Photoshop CS5 (Windows)
Go to last tile in Tile History
Photoshop CS5 Panels — Pattern Maker Only

End


Microsoft Windows 7 (Windows)
Jump to first / jump to last item
Windows Admin — Navigate File List and Navigation Pane

Home / End


Microsoft Windows 7 (Windows)
Jump to beginning / jump to end of item name
Windows Admin — Navigate File List and Navigation Pane

F2 , then home / End


Microsoft Outlook 2010 (Windows)
Go to beginning/end of current view
Messages in Compose View — Navigate Calendar

Home / End


Tekla Structures 14.0 (Windows)
Zoom previous
General shortcuts

End


Mindjet Mindmanager 2012 (Windows)
Move topic top/bottom (remains on same level in hierarchy)
Reorganizing — Move topics

Ctrl + Alt + Home / End


Sublime Text (Windows)
Move to beginning of line/ end of line
Navigation — Standard Navigation

Home / End


Open Office Impress (Linux)
Jump to the last slide in the slide show.
Slide Shows

End


Adobe Photoshop CS5 (MacOS)
Move to the beginning / to the end of the timeline
Extract and Pattern Maker (plug-in) — Animation Panel (Timeline Mode, PS extended)

Home / End


Opera (Linux)
Go to bottom
Navigation

End


Sublime Text (Windows)
Extend selection to beginning/ end of line
Navigation — Standard Selections

Shift + Home / End


Mindjet Mindmanager 2012 (Windows)
uppermost/bottom on the same level
Moving the blue box

Home / End


Sublime Text (Windows)
Extend selection to beginning of file/ end of file
Navigation — Standard Selections

Ctrl + Shift + Home / End


Mindjet Mindmanager 2012 (Windows)
central/lowest
Moving the blue box

Ctrl + Home / End


Adobe Photoshop CS5 (Windows)
Move to the beginning / to the end of the timeline
Extract and Pattern Maker (plug-in) — Animation Panel (Timeline Mode, PS extended)

Home / End


Adobe Photoshop CS4 (MacOS)
Move view to upper-left corner or lower right corner
Shortcut Keys for viewing images

Home / End


Sublime Text (Windows)
Move to beginning of line/ end of line
Selections — Standard Navigation

Home / End


Oracle SQL Developer 4 (Windows)
Jump to beginning of line/ end of line
Code Editor

Home / End


Microsoft Windows 8 (Windows)
Jump to first / jump to last item
Windows Explorer — Navigate File List and Navigation Pane

Home / End


Oracle SQL Developer 4 (Windows)
Expand selection to beginning/ end of line
Code Editor

Shift + Home / End


Microsoft Windows 8 (Windows)
Jump to beginning / jump to end of item name
Windows Explorer — Navigate File List and Navigation Pane

F2 , then Home / End


Oracle SQL Developer 4 (Windows)
Expand selection to beginning/ end of file
Code Editor

Ctrl + Shift + Home / End


Sublime Text (Windows)
Extend selection to beginning/ end of line
Selections — Standard Selections

Shift + Home / End


Sublime Text (Windows)
Extend selection to beginning of file/ end of file
Selections — Standard Selections

Ctrl + Shift + Home / End


Microsoft Windows 7 (Windows)
Jump to first / jump to last item
Ease of Access and Magnifier — Navigate File List and Navigation Pane

Home / End


Microsoft Windows 7 (Windows)
Jump to beginning / jump to end of item name
Ease of Access and Magnifier — Navigate File List and Navigation Pane

F2 , then home / End


Microsoft Excel 2010 (Windows)
Select the first item / last item in the AutoFilter list.
Insert and Edit Data — Auto Filter

Home / End


Access 2010 (Windows)
Select first / select last command in menu
Working with Text and Data — Menus

Home / End


Evernote (Windows)
Go to the first note in list / last note in list
Note List

Home / End


Access 2010 (Windows)
Move beginning / move to end of an entry
Working with Text and Data — Text Boxes

Home / End


Microsoft Outlook 2010 (Windows)
Go to beginning/end of current view
Calendar Shortcuts — Navigate Calendar

Home / End


Access 2010 (Windows)
Move cursor to the beginning / to the end of the field
Working with Text and Data — Edit Text and Data

Home / End


InDesign CS5 (MacOS)
Move to start or end of line
Navigating Through and Editing Text

Home / End


Microsoft Windows 7 (Windows)
Select first / select last object on desktop
Navigating Desktop

Home / End


Microsoft Windows 8 (Windows)
Select first / select last object on desktop
Navigating Desktop

Home / End


InDesign CS5 (MacOS)
Select start or end of line
Navigating Through and Editing Text

Shift + Home /+ End


Photoshop Lightroom 4 (Windows)
Go to beginning/end of Grid view
Comparing photos in the Library module

Home / End


Access 2010 (Windows)
Move to first / move to last field in current record
Working with Text and Data — Navigate in Datasheet, Subdatasheet, and Form View

Home / End


Photoshop Lightroom 4 (MacOS)
Go to beginning/end of Grid view
Comparing photos in the Library module

Home / End


Adobe Photoshop CS5 (MacOS)
Go to last tile in Tile History
Extract and Pattern Maker (plug-in) — Pattern Maker Only

End


Microsoft Windows 7 (Windows)
Move to the beginning / to the end of a topic
Windows Help

Home / End


Access 2010 (Windows)
Go to the first cell / go to last cell in row
Working with Text and Data — Database Diagram

Home / End


CATIA V5 (Windows)
Display the bottom of the graph
38 Shortcuts for CATIA V5 (Windows)

End


Microsoft PowerPoint 2010 (Windows)
Move to the end of a line.
Basic Text Navigation and Formatting

End


InDesign CS5 (MacOS)
Select first/last XML node
Working with XML

Home / End


Adobe Photoshop CS5 (Windows)
Go to last tile in Tile History
Extract and Pattern Maker (plug-in) — Pattern Maker Only

End


Adobe Photoshop CS4 (MacOS)
Move to the end of the timeline
Shortcut Keys for using the Animation panel in Timeline Mode (Photoshop Extended)

End


Microsoft Outlook 2010 (Windows)
Select first / select last card in list
Business Card View

Home / End


Microsoft Excel 2010 (Windows)
Select the first item / last item in the AutoFilter list.
Format Data — Auto Filter

Home / End


Adobe Photoshop CS5 (MacOS)
Move view to upper-left corner or lower right corner
View images

Home / End


Adobe Photoshop CS5 (Windows)
Move view to upper-left corner or lower right corner
View Images

Home / End


HoneyView 5.03 (Windows)
first image / last image
Main Shortcuts

Home / End


Youtube Player (Windows)
Jump to the end of the video (if video not in playlist)
Navigate Video

End


Audacity 2 (Linux)
Skip to end
Frequently Used

End


Audacity 2 (Linux)
Skip to end
Transport Menu

End


Access 2010 (Windows)
Select first / select last command in menu
Working with Access Views — Menus

Home / End


Microsoft PowerPoint 2010 (Windows)
Move to the end of the entry.
Work with Dialog Boxes

End


Access 2010 (Windows)
Move beginning / move to end of an entry
Working with Access Views — Text Boxes

Home / End


Microsoft Excel 2013 (Windows)
Inside a cell: Move to the beginning / to the end of a cell entry
Navigate Worksheets

Home / End


Microsoft Excel 2013 (Windows)
Turn ‘End’ mode on In End mode, press arrow keys to move to the next nonblank cell in the same column or row as the active cell From here use arrow keys to move by blocks of data, home to move to last cell, or enter to move to the last cell to the right
Navigate Worksheets

End


Microsoft Word 2013 (Windows)
Jump to the end of a line / beginning of a line
Navigate in Word Documents

End / Home


Microsoft Excel 2013 (Windows)
Inside a cell: Select from the insertion point to the beginning / to the end of the cell
Basic and Advanced Cell Selections

Shift + Home / End


Access 2010 (Windows)
Move cursor to the beginning / to the end of the field
Working with Access Views — Edit Text and Data

Home / End


Audacity 2 (Windows)
Skip to end
Transport Menu

End


Virtual DJ (Windows)
skip_beat -1
All Shortcuts

End


Access 2010 (Windows)
Move to first / move to last field in current record
Working with Access Views — Navigate in Datasheet, Subdatasheet, and Form View

Home / End


Microsoft Excel 2010 (Windows)
Select the first item / last item in the AutoFilter list.
Formulas and Names — Auto Filter

Home / End


Adobe Acrobat Pro (Windows)
Last page
Navigation — Navigating a PDF

End / Shift + Ctrl + Page Down / Shift + Ctrl + Arrow Down


Presonus Studio One (Windows)
End
Navigation

End


Access 2010 (Windows)
Go to the first cell / go to last cell in row
Working with Access Views — Database Diagram

Home / End


Adobe Flash Professional (Windows)
Go to Last Scene
Timeline

End


Axialis IconWorkshop (Windows)
Set floating selection to background
Draw Menu

End / Home


FileMaker Pro (Windows)
Move to beginning of the line / to end of the lien
Layout Mode Shortcuts — Text Navigation

Home / End


FileMaker Pro (Windows)
Select to beginning of text / to end of text
Layout Mode Shortcuts — Select Text

Ctrl + Shift + Home / End


Linux Mint (Linux)
Select the first or last item in the window
File Manager (Nemo) — Selecting Items

Home / End


Windows 10 Command Prompt (Windows)
Extend selection to the beginning/ to the end of screen buffer
Select Text (Expanded with Windows 10)

Ctrl + Shift + Home / End


Windows 10 Command Prompt (Windows)
Jump to beginning, jump to end of the line
Navigate Text

Home / End


Microsoft Windows 10 (Windows)
Jump to first / jump to last item
Navigate File List and Navigation Pane

Home / End


Microsoft Excel 2013 (Windows)
Select the first / last visible item in the list
Pivot Tables

Home / End


Adobe Acrobat Pro (Windows)
If in the body of the file list, move to the first or last row
PDF Portfolios

Home / End


Microsoft Excel 2013 (Windows)
Select the first item / last item in the AutoFilter list
Auto Filter

Home / End


Microsoft Excel 2013 (Windows)
Move to the beginning / end of a field
Data Forms

Home / End


Google Chrome (MacOS)
Jump to beginning / to end of webpage
View Webpages

Home / End


Access 2010 (Windows)
Select first / select last command in menu
The Rest — Menus

Home / End


Microsoft Excel 2010 (Windows)
Select the first item / last item in the AutoFilter list.
The Rest — Auto Filter

Home / End


Access 2010 (Windows)
Move beginning / move to end of an entry
The Rest — Text Boxes

Home / End


GTDNext.com (Windows)
Go to end of line
Center Pane Shortcuts

End


Microsoft Excel 2010 (Windows)
Inside a cell: Move to the beginning / to the end of a cell entry.
Navigate Inside Worksheets

Home / End


Microsoft Excel 2010 (Windows)
Turn ‘End’ mode on. In End mode, press arrow keys to move to the next nonblank cell in the same column or row as the active cell. From here use arrow keys to move by blocks of data, home to move to last cell, or enter to move to the last cell to the right.
Navigate Inside Worksheets

End


Access 2010 (Windows)
Move cursor to the beginning / to the end of the field
The Rest — Edit Text and Data

Home / End


Microsoft OneNote 2016 (Windows)
Move to beginning/ end of the line
Basic Editing and Formatting

Home / End


Microsoft OneNote 2016 (Windows)
Move to top/ bottom of current page
Basic Editing and Formatting

Ctrl + Home / End


FileMaker Pro (Windows)
Move to beginning of the line / to end of the lien
Text Shortcuts — Text Navigation

Home / End


Microsoft OneNote 2016 (Windows)
Select to the beginning/ end of line
Basic Editing and Formatting

Shift + Home / End


FileMaker Pro (Windows)
Select to beginning of text / to end of text
Text Shortcuts — Select Text

Ctrl + Shift + Home / End


Google Mail (MacOS)
Jump to beginning of page / end of page
Control Main Browser Window (General Browser Shortcuts)

End / Home


Microsoft OneNote 2016 (Windows)
Go to first/ last page in the section
Manage Pages, Notebooks and Sections

Alt + Home / End


Skype for Business (Lync) 2016 (Windows)
Move top / move to bottom of list
Conversation Environment

Home / End


Microsoft Excel 2010 (Windows)
Move to the beginning / end of a field.
Data Forms

Home / End


Skype for Business (Lync) 2016 (Windows)
With thumbnails in focus — Move to first / move to last slide thumbnail
PowerPoint Sharing

Home / End


Access 2010 (Windows)
Move to first / move to last field in current record
The Rest — Navigate in Datasheet, Subdatasheet, and Form View

Home / End


Microsoft Excel 2010 (Windows)
Select the first / last visible item in the list.
Pivot Tables

Home / End


Adobe After Effects CC (Windows)
Go to beginning / go to end of Composition, Layer, or Footage item (or Ctrl+Alt+Left Arrow/Right Arrow)
Time Navigation

Home / End


Adobe After Effects CC (MacOS)
Go to beginning or end of work area
Time Navigation

Shift + Home / End


Adobe After Effects CC (MacOS)
Go to beginning / go to end of Composition, Layer, or footage item (or Command+Option+Left Arrow/Right Arrow)
Time Navigation

Home / End


Access 2010 (Windows)
Go to the first cell / go to last cell in row
The Rest — Database Diagram

Home / End


Google Slides (Windows)
Move to 1st slide / Move to last slide
Working Point Navigation Action

Home / End


Microsoft PowerPoint 2016 (Windows)
End of line
Navigation Operation

End


Photoshop Lightroom CC (MacOS)
Go to beginning/ end of Grid view
Comparing Photos in the Library Module

Home / End


Photoshop Lightroom CC (Windows)
Go to beginning/ end of Grid view
Comparing Photos in the Library Module

Home / End


Access 2016 (Windows)
Move to End
Windows/Content Switching/Navigation

End


Onshape (Windows)
First/ last sheet
Drawings

Home / End


Microsoft Excel 2016 (Windows)
Move to the beginning/ end of a field
Select Cells — Data Forms

Home / End


Onshape (MacOS)
First/ last sheet
Drawings

Home / End


Corel VideoStudio X9.5 (Windows)
Go to ending segment
Navigation/Direction Shortcuts

End


Microsoft Visio 2016 (Windows)
Move to the end of entry
Window/Navigation Shortcut

End


Adobe Audition CC (Windows)
Set time indicator to end
Audio General Operations

End


Adobe Audition CC (MacOS)
Set time indicator to end
Audio General Operations

End


FileMaker Pro (Windows)
Move to beginning of the line / to end of the lien
Database Management Shortcuts — Text Navigation

Home / End


Adobe Premiere CC (Windows)
Go to sequence clip end
Clipping Shortcuts

End


FileMaker Pro (Windows)
Select to beginning of text / to end of text
Database Management Shortcuts — Select Text

Ctrl + Shift + Home / End


Adobe Premiere CC (MacOS)
Go to sequence clip end
Clipping Shortcuts

End


Apple Keynote (MacOS)
Move to the end
Chart data editor

End


Apple Numbers (MacOS)
Go to end of spreadsheet
Navigation Shortcuts

End


Microsoft PowerPoint 2016 (Windows)
End Slideshow
Slide Operations(Presentation time)

Esc / End


Microsoft Excel 2016 (Windows)
Move to the beginning/ end of a field
Format Cells — Data Forms

Home / End


Microsoft Outlook 2016 (Windows)
Select the first/last group
Groups

Home / End


FileMaker Pro (MacOS)
Scroll to the beginning / end of the document
Navigation and Window Display

Home / End


Corel Painter 2017 (MacOS)
Last frame of stack
Navigation Shortcuts

End


Corel Painter 2017 (Windows)
Last frame of stack
Navigation Shortcuts

End


Microsoft Outlook 2016 (Windows)
Select the first/last card in the list
View: Business Cards/Address cards

Home / End


Apple Keynote (MacOS)
Scroll to end of canvas
Text Editing

End


Nuke 10 (Windows)
Go to last frame
2D Viewer

End


Nuke 10 (MacOS)
Go to last frame
2D Viewer

End


Adobe After Effects CC (Windows)
Select text from insertion point to beginning / end of line
Text

Shift + Home / End


Nuke 10 (Linux)
Go to last frame
2D Viewer

End


Adobe After Effects CC (Windows)
Move cursor to beginning / end of line
Text

Home / End


Apple Keynote (MacOS)
Go to last slide
Slideshow

End


Microsoft Outlook 2016 (Windows)
Move to the beginning/end of a line (when a field in a card is selected)
View: Business Cards/Address cards

Home / End


Adobe After Effects CC (Windows)
Select text from cursor to beginning / end of text Frame
Text

Ctrl + Shift + Home / End


Microsoft Outlook 2016 (Windows)
Select the first/last item on the timeline (if items are not grouped) or the first item in the group
View: Timeline (Tasks) — When an item is selected

Home / End


Adobe After Effects CC (MacOS)
Select text from insertion point to beginning / end of line
Text

Shift +
Home / End


Adobe After Effects CC (MacOS)
Move cursor to beginning / end of line
Text

Home / End


Adobe After Effects CC (MacOS)
Select text from cursor to beginning / end of text Frame
Text

Command + Shift +
Home / End


Microsoft Outlook 2016 (Windows)
Select the first/last group on the timeline
View: Timeline (Tasks) — When a group is selected

Home / End


Finale (MacOS)
Right One screen
Navigation Shortcuts

End


Microsoft Outlook 2016 (Windows)
Select the time that ends your work day
View: Calendar — Day View

End


Finale (Windows)
Right One screen
Navigation Shortcuts

End


Microsoft Outlook 2016 (Windows)
Go to the start/end of work hours for the selected day
View: Calendar — Week View

Home / End


Microsoft Excel 2016 (Windows)
Move to the beginning/ end of a field
Formulas — Data Forms

Home / End


Anime Studio (Windows)
Zoom(to show all)
Graph Shortcuts

End


Apple Motion (MacOS)
Go to the end of a project
General Interface

End


Zoho Writer (Windows)
Go to End of line from the current cursor position
Navigation keys

End


Dynamics NAV 2015 (Windows)
Move to the Last Field on a line
Normal Shortcuts

End


CINEMA 4D (Windows)
Jump End
Structure Manager

End


Microsoft Word 2016 (Windows)
End of line
Navigation Operation

End


Apple Photos (Windows)
Move to the bottom of the photo library
Organize

End


Apple Motion (MacOS)
Go to the end of a project
Mark Menu

End


Windows Movie Maker (Windows)
Go to the last item
Navigation

End


Anime Studio (MacOS)
Zoom(to show all)
Graph Shortcuts

End


GIMP (Linux)
Select Top/Bottom Layer
Layer

Home / End


Adobe Photoshop CC (Windows)
Scroll to to upper-left/ lower-right corner
Manage Views

Home / End


Adobe Photoshop CC (MacOS)
Scroll to to upper-left/ lower-right corner
Manage Views

Home / End


Microsoft Excel 2016 (Windows)
Move to the beginning/ end of a field
Manage Workbooks — Data Forms

Home / End


Microsoft Projects 2016 (Windows)
Move to the end of the entry.
Navigation Shortcuts

End


GIMP (MacOS)
Select Top/Bottom Layer
Layer Shortcuts

Home / End


Ace Projects (Windows)
Go to line end
Navigation Shortcuts

Alt + Right Arrow / End


GIMP (Windows)
Select Top/Bottom Layer
Layer Shortcuts

Home / End


Microsoft Projects 2016 (Windows)
Move to the end of a line.
Moving around cells/text

End


Autodesk Inventor 2017 (Windows)
Zoom selected
View

End


Adobe Acrobat Pro (MacOS)
Last page
Navigation — Navigating a PDF

End / Shift + Command + Page Down / Shift + Command + Down Arrow


AutoCad Architecture 2017 (Windows)
Moves the cursor to the end of the current line
Text Editing

End


Apple Photos (MacOS)
Move to the bottom of the photo library
Organize

End


Adobe Flash Professional (MacOS)
Go to Last Scene
Timeline

End


Zoho Writer (MacOS)
Go to End of line from the current cursor position
Navigation Shortcuts

End


Microsoft Projects 2016 (Windows)
Move to the end of the line.
Working with OfficeArt Objects

End


Apple Pages (MacOS)
Move to the last filled cell to the right in the current row
Editing chart data

End


Autodesk 3ds Max 2017 (Windows)
Go to end frame
Key and Time controls

End


Microsoft Excel 2016 (Windows)
Move to the beginning/ end of a field
Excel Auto Tables and Data Forms — Data Forms

Home / End


Final Cut Pro (MacOS)
To end of media
Navigation

End


Microsoft Excel 2016 (Windows)
Jump to beginning/ end of cell
Edit Cell Content

Home / End


Microsoft Excel 2016 (Windows)
Select from the insertion point to beginning/ end of cell
Edit Cell Content

Shift + Home / End


Adobe Acrobat Pro (MacOS)
If in the body of the file list, move to the first or last row
PDF Portfolios

Home / End


Slack (Windows)
Scroll Down
Navigation Controls

End / PgDn


Microsoft Excel 2016 (Windows)
Select the first item/ last item in the AutoFilter list
Auto Filter

Home / End


Windows 10 File Explorer (Windows)
Go to first itme/ last item
Left Navigation Pane Shortctus

Home / End


Bash (Linux)
Go to End of Line
Navigation

Ctrl + E / End


Windows 10 File Explorer (Windows)
Go to first itme/ last item
Folder Content (Main Pane) — Navigate Files/ Folders

Home / End


Cloud9 (MacOS)
Goto Start/ End
Goto

Command + Home / End


Cloud9 (Windows)
Goto Start/End
Navigate

Ctrl + Home / End


Zimbra Collaboration Suite 8 (Windows)
Select Last Item
Lists

End


Daz 3D Bryce 7 (Windows)
Bottom of List
Advance Motion Lab

End


Daz 3D Bryce 7 (MacOS)
Bottom of List
Advance Motion Lab

End


jEdit (Windows)
Last Non-space Character
Moving the Caret

End


Adobe Bridge CC (MacOS)
Move to Last Item
35 Shortcuts for Adobe Bridge CC (MacOS)

End


Adobe Bridge CC (Windows)
Move to Last Item
35 Shortcuts for Adobe Bridge CC (Windows)

End


Opera (Windows)
Go to bottom
Navigation

End


Corel Ventura 10 (Windows)
Move Cursot ro Beginning/End of Line
Cursor Movement

Home / End


Opera (MacOS)
Go to bottom
Navigation

End


Pinnacle Studio Ultimate 20 (Windows)
Go to End
Navigation

R / End


ACDSee (Windows)
Display Last Selected Item
View Mode

End


Steinberg Cubase 9 (Windows)
End
Navigate

End


Steinberg Cubase 9 (MacOS)
End
Navigate

End


InCopy CC (Windows)
Go to beginning/end of line
Navigation Shortcuts

Home / End


InCopy CC (MacOS)
Go to beginning/end of line
Navigation Shortcuts

Home / End


InCopy CC (Windows)
Go to beginning/end of story
Navigation Shortcuts

Ctrl + Home / End


InCopy CC (MacOS)
Go to beginning/end of story
Navigation Shortcuts

Command + Home / End


InCopy CC (Windows)
Select to the start/end of the line
Navigation Shortcuts

Shift + Home / End


HTML-Kit (Windows)
Go to End of Line
87 Shortcuts for HTML-Kit (Windows)

End


InCopy CC (MacOS)
Select to the start/end of the line
Navigation Shortcuts

Shift + Home / End


InCopy CC (Windows)
Select to beginning/end of story
Navigation Shortcuts

Ctrl + Shift + Home / End


Corel Ventura 10 (Windows)
Select End Node of Curve
Node Editing

End


InCopy CC (MacOS)
Select to beginning/end of story
Navigation Shortcuts

Command + Shift + Home / End


Corel Draw X8 (Windows)
Cursor to end of line
Cursor Moves Using Text Tool

End


Edius (Windows)
Move to end
General

END


MAGIX Movie Edit Pro (Windows)
Playback marker to end
PlayBack Functions

End


Final Fantasy XV (Windows)
Return camera to saved position
Camera

End


InCopy CC (MacOS)
Move to first/last cell in row
Tables

Option + Home / End


InCopy CC (Windows)
Move to first/last cell in row
Tables

Alt + Home / End


Kingsoft Writer 2016 (Windows)
Go to End of Line
Navigation Shortcuts

End


InCopy CC (MacOS)
Select first/last XML node
Working with XML

Home / End


InCopy CC (MacOS)
Extend selection to first/last XML node
Working with XML

Shift + Home / End


InCopy CC (Windows)
Select first/last XML node
Working with XML

Home / End


InCopy CC (Windows)
Extend selection to first/last XML node
Working with XML

Shift + Home / End


Adobe Captivate 2017 (Windows)
Stop recording
Recording

End


Apple Motion (MacOS)
Go to the end of project
TimeLine Editing and Navigation

End


Informix Genero 2.5.0 (Windows)
End of line
Cursor Movement Shortcuts

End


IBM Director (Windows)
Scroll down in Frame
14 Shortcuts for IBM Director (Windows)

End


FxPro (Windows)
Go to Latest Trend Bar
Navigation and Scrolling

End


Garageband 10 (MacOS)
Move forward by visible width of the timeline
General Shortcuts

End


MediaMonkey (Windows)
Select Last Track
Standard Keyboard Shortcuts

End


MPS 2017 (Windows)
Move the caret to the end of line
Basic Editing

End


MetaTrader MT4 (Windows)
Move Chart to End Point
Navigation

End


Vuze (Windows)
Move selected torrent(s) to Top/Bottom of List
General Shortcuts

Ctrl + Home / End


Vuze (MacOS)
Move selected torrent(s) to Top/Bottom of List
General Shortcuts

Command + Home / End


Soundforge (Windows)
Go to the last sample visible in the waveform display (or end of selection)
Cursor Movements

End


Vegas Pro 14 (Windows)
Go to end of time selection or viewable area (if no time selection)
Cursor Placement,Loop Region and Time Selection

End


VideoPad Video Editor (Windows)
Go to end
Timeline

End


VideoPad Video Editor (MacOS)
Go to end
Timeline

End


Libreoffice Writer (Windows)
Go to end of line
General

End


Visual Studio Code (Windows)
Go to End of line
Editing Shortcuts

End


GOM Player (Windows)
Next Subtitle Sync
Subtitles

End


Editpad 7 (Windows)
Move the text cursor to the End of the line
Cursor navigation keys

End


Quickbooks Desktop (Windows)
Go to beginning / go to end of account list
Chart of Accounts

Home / End


Synfig (Windows)
Jump to end of timeline
73 Shortcuts for Synfig (Windows)

End


Quickbooks Desktop (Windows)
Beginning of current field
General Editing

Home / End


Vegas Pro 14 (Windows)
Jump to left/right edge of image
RedEye Reduction

Home / End


Bitcomet (Windows)
Move selection to the bottom of the list
Task lists

End


RStudio (Windows)
Move cursor to end of line
Console

End


iClone 7 (Windows)
Go to End frame
Timeline Shortcuts

End


CityEngine (Windows)
Select next pattern
48 Shortcuts for CityEngine (Windows)

End


CityEngine (MacOS)
Select next pattern
48 Shortcuts for CityEngine (MacOS)

End


Visual Studio Code (Windows)
Scroll to top/bottom
Integrated Terminal

Ctrl + Home/End


Rhino (Windows)
Redo View
Default Shortcuts

End


Gigabyte Aorus motherboard
Open Q-Flash (BIOS flash utility)
POST screen shortcuts

End


Kate (Linux)
Move the cursor to the end of the line
29 Shortcuts for Kate (Linux)

End


Geany (Linux)
Go to End of Line
Moving around in the document

End


Geany (Windows)
Go to End of Line
Moving around in the document

End


Kate (Windows)
Move the cursor to the end of the line
38 Shortcuts for Kate (Windows)

End


RStudio (Windows)
Jump to start/end
Editing (Console and Source)

Ctrl + Home/End / Ctrl + Up/Down


ChessBase 13
Go to end of notation
Board window

End


RStudio (MacOS)
Jump to start/end
Editing (Console and Source)

Command + Home/End / Command + Up/Down


Most used text editing
Move cursor to end of current line
Moving the cursor

End


RStudio (Windows)
Select page start/end
Editing (Console and Source)

Ctrl + Shift + Home/End


Comodo IceDragon (Windows)
Go to Bottom of Page
Viewing, Printing and Saving Current Page

End


RStudio (MacOS)
Select page start/end
Editing (Console and Source)

Command + Shift + Home/End


Source Insight (Windows)
End of Line
General

End


Wordfast Pro (Windows)
Line End
100 Shortcuts for Wordfast Pro (Windows)

End


Wordfast Pro (MacOS)
Line End
100 Shortcuts for Wordfast Pro (MacOS)

End


PhotoFiltre (Windows)
Last image
Navigation keys

End


RStudio
Move cursor to end of line
Console

End


KiCad 5.0.2
Double click
Page Layout Editor

End


Place Anywhere (Fallout 4 mod)
Turn object physics on (make it static if possible)
General

End


Comodo IceDragon (Windows)
Seek to the end
Audio and Video Shortcuts

End


DaVinci Resolve 14 (Windows)
Go to Timeline End
Playback

End


DaVinci Resolve 14 (MacOS)
Go to Timeline End
Playback

End


KiCAD (Windows)
End Track
PCB

End


KiCAD (Linux)
End Track
PCB

End


KiCAD (MacOS)
End Track
PCB

End


KiCAD (Linux)
Edit Item
PCB

End


FEKO (Windows)
Move to end of line
General EDITFEKO Shortcuts

End


KiCAD (Windows)
Edit Item
PCB

End


Inkscape (Windows)
Lower selection to bottom
Objects

End


KiCAD (MacOS)
Edit Item
PCB

End


FEKO (Linux)
Move to end of line
General EDITFEKO Shortcuts

End


Modo (Windows)
Reset the Work Plane
Work Plane

End


Ulead PhotoImpact 8 (Windows)
Scroll image horizontally
Miscellaneous

Home / End


Inkscape (MacOS)
Lower selection to bottom
Object

End


Ableton Live 9 (Windows)
Move Insert Marker to End
Clip View MIDI Editor

End


Modo (MacOS)
Reset the Work Plane
Work Plane

End


LDCad
2: While the mouse is inside the animation panel it will seek the last frame instead
Editor

End


LDView
Last step
Steps

End


Ableton Live 9 (MacOS)
Move Insert Marker to End
Clip View MIDI Editor

End


Inkscape (MacOS)
Set pen width to 1 or 100
Calligraphy tool

Home / End


Bus Simulator 18
Finish trip
Special

End


Foxit Reader (Windows)
Last Page
30 Shortcuts for Foxit Reader (Windows)

End


gThumb (Linux)
View the last image
Viewer

End


Foxit Reader (Linux)
Last Page
30 Shortcuts for Foxit Reader (Linux)

End


Foxit Reader (MacOS)
Last Page
30 Shortcuts for Foxit Reader (MacOS)

End


Xyplorer
First/Last image
Other Shortcuts

End


WavePad Sound Editor (Windows)
Go to End
Move And Select Operations

End


WavPad Sound Editor (MacOS)
Go to End
Move And Select Operations

End


Altium Designer (Windows)
Redraw the screen
Common Schematic and PCB Editor Shortcuts

End


DaVinci Resolve 15 (Mac)
Go to timeline end
Playback

End


gThumb (Linux)
Go to the last file in the browser view
Navigation

End


Inkscape (MacOS)
Set brush width by 1
Tweak tool

Home / End


MuseScore (Windows)
End of Score
Navigation Shortcuts

End


AVS Audio Editor (Windows)
Move cursor to the end of the waveform on the Timeline
Navigation

End


MuseScore (MacOS)
End of Score
Navigation Shortcuts

End


AVS Video Editor (Windows)
Project end
Timeline Shortcuts

End


MindManager v19 (Windows)
Move topic top/bottom (remains on same level in hierarchy)
Most used — Move topics

Ctrl + Alt + Home / End


NetSuite
Go to the last page of the report
Viewing reports

End


EasyWorship
Select the Last Slide
Show control

End


MindManager v19 (Windows)
Move topic top/bottom (remains on same level in hierarchy)
Reorganizing — Move topics

Ctrl + Alt + Home / End


word-vba-tutorial-susan
Image: Sai/Adobe Stock

Visual Basic for Applications is the language behind the Office apps that allows you to automate tasks. But using VBA in Word has its challenges. The first is moving around in a document because of all the different types of content: Text, pictures, tables and so on. In this tutorial, I’ll show you two simple VBA procedures for navigating. One identifies the beginning of a Word document, and the other identifies the document’s end.

I’m using Microsoft 365 on a Windows 10 64-bit system, but you can use an earlier version. You may access the demo files here. Word for the web doesn’t support VBA.

SEE: Google Workspace vs. Microsoft 365: A side-by-side analysis w/checklist (TechRepublic Premium)

About Microsoft Word VBA’s ActiveDocument

The main VBA component that we’ll rely on in both procedures is the ActiveDocument property, which returns a Document object that represents the active document. In other words, this opens the document, as a whole. You won’t need this for every VBA procedure in Word, but you will need it when you need to reference “parts” of the document.

If no Word document is open, this property returns an error. If you’re using this property from inside Excel or PowerPoint, you should include error-handling for this situation.

This property uses the following form:

expression.ActiveDocument

where expression is a variable that represents the Application object (Word). Fortunately, in Word, this is implicitly implied.

The next piece of VBA we’ll use is the Range method, which uses the form

expression.Range(start, end)

to return a Range object. We’ll use this method to identify an area of the document.

There’s no method that says “go to the beginning,” or “go to the end,” so we’ll use the start and end arguments to identify both. Both arguments are optional, and as you might suspect, start identifies the first character position and end identifies the last character position.

Now, let’s move on to the actual VBA procedures.

How to use VBA to find the beginning of a Word document

Moving the cursor to the beginning of a Word document using VBA is amazingly simple. Listing A shows the procedure. First, the procedure declares and defines a range object, using 0s to identify the beginning of the document. Two 0s will place the cursor before any content in the active document. The second line adds a bit of text and the vbNewLine constant adds a new line.

Listing A

Sub GoToStart()

'Move cursor to the beginning of the active document.

'Add a short text phrase to show it worked.

Dim rBegin As Range

Set rBegin = ActiveDocument.Range(0, 0)

rBegin.Text = "This is the beginning of this document." & vbNewLine

End Sub

Now let’s look at the second procedure that moves the cursor to the end of a document.

How to use VBA to find the end of a Word document

As mentioned, there is no method that says “go to the end,” so we need to force the issue by finding the last character. It is a bit more complex, but not difficult, as shown in Listing B. This procedure works similar to the first, but it enters the text at the end of the document, which it finds by using the Last property of the Characters object.

This time we positioned the vbNewLine constant before the text.

Listing B

Sub GoToEnd()

'Move cursor to the end of the active document.

'Add a short text phrase to show it worked.

Dim rEnd As Range

Set rEnd = ActiveDocument.Range.Characters.Last

rEnd.Text = vbNewLine & "This is the end of this document."

End Sub

How to enter and run the VBA procedures into a Word document

Now it’s time to enter both procedures for use in a Word document. I’m using a short two-page Word document, shown in Figure A, with a variety of content saved as a macro-enabled Word file. If you are using a ribbon version, you must save the Word document as a macro-enabled file to run VBA. If you’re working in the menu version, you can skip this step.

Figure A

WordVBA_A

Image: Susan Harkins/TechRepublic. The VBA procedures will add a bit of content to the beginning and the end of this Word document.

To enter the VBA procedures, press Alt + F11 to open the Visual Basic Editor (VBE). In the Project Explorer to the left, select ThisDocument. You can enter the code manually or import the downloadable .cls file. In addition, the procedure is in the downloadable .docm and .doc files. If you enter the code manually, don’t paste from this web page. Instead, copy the code into a text editor and then paste that code into the ThisDocument module. Doing so will remove any phantom web characters that might otherwise cause errors.

Now let’s run the procedures as follows:

  1. Click the Developer tab.
  2. Choose Macros in the Code group.
  3. In the resulting dialog, choose GoToStart (Figure B).
  4. Click Run.

As you can see in Figure C, the procedure inserts text and a line break at the beginning of the Word document. Now let’s repeat this process but choose GoToEnd (Figure B). This procedure inserts a line break and a bit of text to the end of the Word document, as you can see in Figure D.

Figure B

WordVBA_B

Image: Susan Harkins/TechRepublic. Choose the procedure.

Figure C

WordVBA_C

Image: Susan Harkins/TechRepublic. GoToStart() added a sentence to the beginning of the Word document.

Figure D

WordVBA_D

Image: Susan Harkins/TechRepublic. GoToEnd() added a sentence to the end of the Word document.

One thing you might notice is that both of the inserted sentences use different formats. These sentences, like any other, will use the format in place. This is worth remembering if you want inserted text to use a specific format instead.

Most likely, you won’t want to work through all those steps to run this macro. I recommend that you add it to the Quick Access Toolbar or a custom group. If you need help with that, read How to add Office macros to the QAT toolbar for quick access.

Stay tuned

Both VBA procedures are simple — both the procedures themselves and the tasks they complete. The goal is to show you how to navigate to both spots using VBA. Over the next few months, I’ll devote a few articles to more navigational VBA in Microsoft Word documents.

Like this post? Please share to your friends:
  • End of the word video
  • End of the word today
  • End of the word signs
  • End of the word regex
  • End of the word of god