SlideShare a Scribd company logo
Astrid Yolanda
Program Studi S1 Sistem
Informasi
Fakultas Sains dan Teknologi
Universitas Islam Negeri Sultan Syarif Kasim Riau
Opening the Visual Basic
Editor with a Macro Selected
Opening the Visual Basic Editor
1. Open Word if it’s not already
running.
2. Press Alt+F8 to display the
Macros dialog box.
3. Select the
Transpose_Word_Right macro and
click the Edit button. Word opens
the
Visual Basic Editor with the macro
displayed and ready for editing,
4. Choose File ➢ Close to close
the Visual Basic Editor for the
moment so that you can open
it using the method described in
the next section.
1
Code window
Properties window
Project Explorer
Opening the Visual Basic Editor
Directly
1. Open or activate
the host application.
In this case, open or
switch to Word.
2. Press Alt+F11.
The Visual Basic
Editor opens.
2
Using the Visual Basic Editor’s
Main Windows
The Project Explorer
View Code
View Object
Toggle FoldersThe Project Explorer is the tool for navigating among the
various objects in the Visual Basic
Editor.
View
Code
• Displays the Code window for the selected
objec
View
Object
• Displays a window containing
the selected object. T
Toggle
Folders
• Toggles the view of the objects in the
Project Explorer between folder view
and contents view
Depending on the host application and its capabilities, each project can contain
some or all of the following elements.
User forms (windows that make up part of the macro’s user
interface, such as a custom dialog box that accepts user input).
Modules containing macros, procedures, and functions.
Class modules (specialized modules that defi ne objects,
their properties, and their values).
References to other projects or to library fi les (such as DLLs—
Dynamic Link Libraries).
Objects related to the application.
The Object Browser
The Visual Basic Editor provides a full Object Browser for working with objects in
VBA. You’ll look at the Object Browser in detail in Chapter 8, “Finding the Objects,
Methods, and Properties You Need,” and when you examine the object models for the
various Office applications in the final part of this book.
The Document object is selected in the left-hand panel, and a list of its
properties appears in the right-hand panel. (To see this in your VBA Editor,
press F2.)
The Code Window
Complete
Word
• The Complete Word feature can complete the word you’re typing into the Code window, once you’ve typed
enough letters to distinguish that word from any other. If you haven’t typed enough letters to distinguish the
word, the Visual Basic Editor gives you the closest possibilities. You can either “type down” (continue typing to
narrow the selection) or scroll through the displayed list to fi nd the one you want.
Clear All Bookmarks
Previous Bookmark
Next Bookmark
Toggle Bookmark
Uncomment Block
Comment Block
Toggle Breakpoint
Outdent
Indent
Complete Word
Parameter Info
Quick Info
List Constants
List Properties/Methods
Quick Info
• The Complete Word feature can complete the word you’re typing into the Code window, once you’ve typed enough letters to
distinguish that word from any other. If you haven’t typed enough letters to distinguish the word, the Visual Basic Editor gives you
the closest possibilities. You can either “type down” (continue typing to narrow the selection) or scroll through the displayed list to
fi nd the one you want. The Quick Info feature displays a ScreenTip showing syntax information about the currently selected
variable, function, method, command, or sub. (Selected here just means the word in the code that’s under or adjacent to the
blinking cursor insertion point.) If you type in a command like MsgBox and then press the spacebar, the ScreenTip pops up to help
you complete typing in the command. The tip shows both the required and optional elements of that command. Optional
elements are enclosed in square brackets.
If you’re typing in
actual commands from
the VBA language, the
easiest way to see
Quick Info is just to
type the command’s
name and then press
the spacebar key
Position the insertion
point in the term and
choose Edit ➢ Quick
Info.
Position the insertion
point in the command
and press Ctrl+I.
Right-click a VB
command and choose
Quick Info from the
shortcut menu.
Click the Quick Info
icon on the Edit
toolbar.
Just type a space
following a VB
command. For
example, type msgbox
(space).
To display Quick Info, use one of these methods:
Auto List
Members
• Many VB commands have properties (qualities) and methods (behaviors). Taken together, the properties
and methods of an object are called its members. The Auto List Members list allows you to quickly complete the
line of code. Auto List Members is switched on by default and is automatically displayed when you type a period
in an object description or a comma, parentheses, or other punctuation in a line of code. Notice in Figure 2.10
that I’ve typed in a message-box command followed by the text Hello, Marvin! and then a comma. As soon as I
typed the comma, the list of settings for the Buttons appeared. (These settings are called constants.)
2
a. Press Tab, or double-click the property or method, if you want to continue adding to
this line of code after entering the property or method.
b. Press Enter if you want to start a new line after entering the property or method.
1
Press the down-arrow key to scroll down to the property or method, or scroll down with the mouse. You can also type the fi
rst few letters of the property or method’s name to jump to it.
To use Auto List Members to insert your choice into your
code, follow these steps
List
Constants
• The List Constants feature displays a pop-up list box containing constants for a property you’ve
• typed so that you can quickly complete the expression. List Constants is switched on by default.
• Alternatively, you can display the list box by clicking the List Constants button on the Edit
• toolbar.
1. Type Assistant.Animation = in the
Code window.
2. Press the ↓ (down-arrow) to scroll
down to the constant you’re after, or
type its fi rst letter (or fi rst few
letters), or scroll down with the
mouse.
3. Enter the constant in the code by
doing the following:
• Press Tab, or double-click the constant,
if you want to continue working on the
same line after entering the constant.
• Press Enter if you want to start a new
line after entering the constant.
Setting Properties for a Project
Set the project name in the Project Name text box. This name identifi es the project in the Object Browser and, when
necessary, in the Windows Registry. Make sure the name is unique to avoid confusion with any other project.
Enter a description of the project in the Project Description text box. This description appears in the Description pane in
the Object Browser to help the user understand what the project is. So be as concise, yet descriptive, as possible.
Designate the Help fi le for the project by entering the name and path of the Help fi le in the Help File Name text box. Click
the button marked with the ellipsis (…) to the right of the Help File Name text box to display the Help File dialog box. Then
select the fi le and click the Open button to enter the name of the Help fi le in the text box.
Specify the Help context for the project in the Project Help Context ID text box. The Help context refers to a location in th e
Help fi le
Specify any conditional compilation arguments needed for the project. Some fi nd conditional compilation useful, but most
don’t.
Here’s what you can do on the General tab of the Project Properties dialog box
Customizing the Visual Basic
Editor
Choose Editor and
View preference
settings in the
Visual Basic Editor
to control how it
interacts with you.
Choose which
windows to display
in the Visual Basic
Editor, and
organize their
layout so you can
use your
workspace as
effectively as
possible.
Customize the
toolbar and menus
in the Visual Basic
Editor so the
commands you
need are at hand
(without cluttering
up your
workspace).
Customize the
Toolbox so it
contains the tools
you need to build
your user forms.
Given how much time you’re likely to spend in the Visual Basic Editor, you ought to customize it
so you can work as efficiently and comfortably as possible. You can customize it as follows:
Choosing Editor and View Preferences
Auto Syntax Check Controls whether VBA displays warning message boxes when it discovers errors while
Automatically Checking Your syntax As You type Lines of code.
Require Variable Declaration Governs whether you must declare variables explicitly
Auto List Members Described earlier in this chapter, this option controls whether the Auto List Members and
List Constants features automatically suggest properties, methods, and constants as you work in the Code
window.
Auto quick info this option controls whether the quick info feature automatically displays information about
functions and their parameters as you work with functions in the code window.
Auto Data Tips This option controls whether the Visual Basic Editor displays ScreenTips when you hover the
mouse pointer over a variable or expression in Break mode, enabling you to check the value of a variable or
expression quickly.
Auto Indent Determines whether the Visual Basic Editor automatically indents subsequent Lines Of Code After
you’ve Indented a line. When Auto Indent Switched on, The Visual Basic Editor Starts Each new line Of Code
Indented to the Same Level (the Same Number Of Tabs or spaces or the Same Combination Of The two) as The
Previous line.
Tab Width Sets the number of spaces in a tab.
Drag-And-Drop Text Editing Controls whether the Visual Basic Editor supports dragand-drop.
Default To Full Module View Controls whether the Visual Basic Editor displays all the procedures
in a module in one list (Full Module view) or displays them one at a time (Procedure view).
Procedure Separator Controls whether the Visual Basic Editor displays horizontal lines to separate
the procedures within a module shown in Full Module view in the Code window.
Editor Format Page Options
Normal Text Takes care of much of the text in a typical procedure. You’ll
probably want to make this a conventional color (such as black, the
default).
Selection Text Affects the color of selected (highlighted) text.
Syntax Error Text Affects the color VBA uses for offending lines. The
default color is red.
Execution Point Text Affects the color VBA uses for the line currently
being executed in Break mode.
Breakpoint Text Affects the color in which VBA displays breakpoints
(points where code execution is forced to stop).
Comment Text Affects the color of comment lines. The default color is
dark green.
Keyword Text Affects the color of keywords (words recognized as part of
the VBA language).
Identifi er Text Affects the color VBA uses for identifiers. Identifiers
include the names of variables, constants, and procedures you define.
Bookmark Text Affects the color VBA uses for the bookmarks in your
code.
Call Return Text Affects the color VBA uses for calls to other procedures.
By default, the Visual Basic Editor uses lime green for call return text.
General Page Options
Form Grid
Settings
Group Box
Edit and
Continue
Group Box
Error
Trapping
Group Box
• Break On All Errors
• Break In Class
Module
• Break On
Unhandled Errors
Compile
Group Box
Show
ToolTips and
Collapse Proj.
Hides
Windows
Docking Page Options
The Docking page of the Options dialog box, controls
whether the various windows in the Visual Basic Editor
are dockable—that is, whether they snap automatically
and magnetically to a side of the window when you
move them there. Keeping windows dockable usually
makes for a more organized interface. However, you
may want to make the windows undockable so you can
drag them outside the Visual Basic Editor if necessary
and arrange them as you like on the screen.
Contemporary monitors are becoming quite large, so
you might have plenty of room to display various
windows outside the primary Editor window.
Choosing and Laying Out the Editor Windows
Always make the Code window large—maximize it within
the Editor. If you write long lines of code, you’ll want to
have as much space in the Visual Basic Editor window as
possible. That way your lines won’t wrap and the code will
be easier to read.
Some people fi nd that much of the time they’re actively
writing code, they can dispense with the Project Explorer,
displaying it only when needed. As a handy way of restoring
it, you can put the Project Explorer display command on the
Code window, Code window break, Watch window,
Immediate window, and Locals window context menus.
(You’ll learn how to customize the Editor’s menus in the
next section.) You can also quickly display the Project
Explorer by pressing its shortcut key, Ctrl+R.
Customizing the Toolbar and Menu Bar
There are no menus at all in Word, Excel, Access,
and the other Offi ce applications. And the lone
toolbar is the Quick Access Toolbar. The Ribbon
replaced menus and most toolbars back in 2007.
But the Visual Basic Editor retains the older
interface style—no Ribbon, but instead the classic
menus and toolbars, and you can customize them
to a limited extent. To do this, choose View ➢
Toolbars ➢ Customize (or right-click a toolbar or
the menu bar and choose Customize from the
context menu).
Customizing the Toolbox
Adding Controls to the Toolbox
• Right-click in the Toolbox page (not the tab
itself) where you want to add controls. (You’ll
learn how to add new pages to the Toolbox in
the section “Adding Pages to the Toolbox” a
little later in this chapter.)
• Choose Additional Controls from the context
menu to display the Additional Controls
dialog box.
• In the Available Controls list box, click the
check boxes for the controls you want to add
to the Toolbox, and then click the OK button.
The Bottom Line
– Open the Visual Basic Editor. When you want to create a new macro by hand-programming (as opposed to
recording) or need to modify or test a macro, the Visual Basic Editor is a powerful tool.
Master It Open the Visual Basic Editor in Word and create a simple macro.
– Open a macro in the Visual Basic Editor. You edit and test macro code in the Code window Of the Visual Basic
Editor.
Master It Open the Visual Basic Editor and display a particular macro in the Code window.
– Understand the Project Explorer’s two views. The Project Explorer window displays a tree of current projects.
You can choose between viewing only the files or the folders and fi les.
Master It Switch between folder and contents view in the Project Explorer.
– Set properties for a project. You can specify a project’s name, an associated Help fi le, and other qualities of a
project.
Master It Lock a project so others can’t modify or even read its contents.
– Customize the Visual Basic Editor. The Visual Basic Editor can be customized in many ways, including
personalizing classic menus and toolbars.
Master It Undock the Properties window and change its size. Then redock it.
“ Thank You”

More Related Content

What's hot

Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 abholmes
 
Computer homework
Computer homeworkComputer homework
Computer homeworkadarsh-kaul
 
Module 3 open office writer
Module 3 open office writerModule 3 open office writer
Module 3 open office writer
jaimemgarcia
 
Introduction to word processing
Introduction to word processingIntroduction to word processing
Introduction to word processing
Iddrisu Issah
 
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and timeWord Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Sajna Fathima
 
Create formsexcel
Create formsexcelCreate formsexcel
Create formsexcelRavi Gajul
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowTan Ps
 
Introduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosIntroduction To Excel 2007 Macros
Introduction To Excel 2007 Macros
Excel
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
Jeanie Arnoco
 
Word processing in english ms word
Word processing in english   ms wordWord processing in english   ms word
Word processing in english ms word
eVidhya
 
Welcome to word template
Welcome to word templateWelcome to word template
Welcome to word template
InRai1
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
DCPS
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Daniel DotNet
 
Form4 cd4
Form4 cd4Form4 cd4
Form4 cd4smktsj2
 
Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Creating a quiz using visual basic 6
Creating a quiz using visual basic 6
Ella Marie Wico
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Daniel DotNet
 

What's hot (20)

Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 a
 
Computer homework
Computer homeworkComputer homework
Computer homework
 
More Text Tools
More Text ToolsMore Text Tools
More Text Tools
 
Word
WordWord
Word
 
Excel ch10
Excel ch10Excel ch10
Excel ch10
 
Module 3 open office writer
Module 3 open office writerModule 3 open office writer
Module 3 open office writer
 
Introduction to word processing
Introduction to word processingIntroduction to word processing
Introduction to word processing
 
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and timeWord Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
 
Create formsexcel
Create formsexcelCreate formsexcel
Create formsexcel
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure below
 
VBA
VBAVBA
VBA
 
Introduction To Excel 2007 Macros
Introduction To Excel 2007 MacrosIntroduction To Excel 2007 Macros
Introduction To Excel 2007 Macros
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
Word processing in english ms word
Word processing in english   ms wordWord processing in english   ms word
Word processing in english ms word
 
Welcome to word template
Welcome to word templateWelcome to word template
Welcome to word template
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
 
Form4 cd4
Form4 cd4Form4 cd4
Form4 cd4
 
Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Creating a quiz using visual basic 6
Creating a quiz using visual basic 6
 
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
Apply Bold, Italic and Underline to Selected Text in a RichtextBox using Visu...
 

Similar to Tugas testing

Microsoft word features
Microsoft word featuresMicrosoft word features
Microsoft word features
Saira Randhawa
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
sheenmarie0212
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
Ahllen Javier
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
Ali Mattash
 
Visual basic
Visual basicVisual basic
Visual basic
KavithaAlagumalai
 
Task 2
Task 2Task 2
Task 2
KavitaPunia1
 
MS Word
MS WordMS Word
MS Word
sachinupreti2
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
KavithaAlagumalai
 
Computer applications in business assignment
Computer applications in business assignmentComputer applications in business assignment
Computer applications in business assignmentYogesh Singla
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
Bagzzz
 
Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 abholmes
 
Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 abholmes
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
melody77776
 

Similar to Tugas testing (20)

Word
WordWord
Word
 
Microsoft word features
Microsoft word featuresMicrosoft word features
Microsoft word features
 
Notacd04
Notacd04Notacd04
Notacd04
 
Notacd04
Notacd04Notacd04
Notacd04
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
Visual basic
Visual basicVisual basic
Visual basic
 
Task 2
Task 2Task 2
Task 2
 
MS Word
MS WordMS Word
MS Word
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 
Computer applications in business assignment
Computer applications in business assignmentComputer applications in business assignment
Computer applications in business assignment
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Unit2
Unit2Unit2
Unit2
 
Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 a
 
Microsoft® office word 2003 a
Microsoft® office word 2003 aMicrosoft® office word 2003 a
Microsoft® office word 2003 a
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Visual basic concepts
Visual basic conceptsVisual basic concepts
Visual basic concepts
 

Recently uploaded

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 

Recently uploaded (20)

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 

Tugas testing

  • 1. Astrid Yolanda Program Studi S1 Sistem Informasi Fakultas Sains dan Teknologi Universitas Islam Negeri Sultan Syarif Kasim Riau
  • 2. Opening the Visual Basic Editor with a Macro Selected Opening the Visual Basic Editor 1. Open Word if it’s not already running. 2. Press Alt+F8 to display the Macros dialog box. 3. Select the Transpose_Word_Right macro and click the Edit button. Word opens the Visual Basic Editor with the macro displayed and ready for editing, 4. Choose File ➢ Close to close the Visual Basic Editor for the moment so that you can open it using the method described in the next section. 1 Code window Properties window Project Explorer
  • 3. Opening the Visual Basic Editor Directly 1. Open or activate the host application. In this case, open or switch to Word. 2. Press Alt+F11. The Visual Basic Editor opens. 2
  • 4. Using the Visual Basic Editor’s Main Windows The Project Explorer View Code View Object Toggle FoldersThe Project Explorer is the tool for navigating among the various objects in the Visual Basic Editor. View Code • Displays the Code window for the selected objec View Object • Displays a window containing the selected object. T Toggle Folders • Toggles the view of the objects in the Project Explorer between folder view and contents view
  • 5. Depending on the host application and its capabilities, each project can contain some or all of the following elements. User forms (windows that make up part of the macro’s user interface, such as a custom dialog box that accepts user input). Modules containing macros, procedures, and functions. Class modules (specialized modules that defi ne objects, their properties, and their values). References to other projects or to library fi les (such as DLLs— Dynamic Link Libraries). Objects related to the application.
  • 6. The Object Browser The Visual Basic Editor provides a full Object Browser for working with objects in VBA. You’ll look at the Object Browser in detail in Chapter 8, “Finding the Objects, Methods, and Properties You Need,” and when you examine the object models for the various Office applications in the final part of this book. The Document object is selected in the left-hand panel, and a list of its properties appears in the right-hand panel. (To see this in your VBA Editor, press F2.)
  • 7. The Code Window Complete Word • The Complete Word feature can complete the word you’re typing into the Code window, once you’ve typed enough letters to distinguish that word from any other. If you haven’t typed enough letters to distinguish the word, the Visual Basic Editor gives you the closest possibilities. You can either “type down” (continue typing to narrow the selection) or scroll through the displayed list to fi nd the one you want. Clear All Bookmarks Previous Bookmark Next Bookmark Toggle Bookmark Uncomment Block Comment Block Toggle Breakpoint Outdent Indent Complete Word Parameter Info Quick Info List Constants List Properties/Methods
  • 8. Quick Info • The Complete Word feature can complete the word you’re typing into the Code window, once you’ve typed enough letters to distinguish that word from any other. If you haven’t typed enough letters to distinguish the word, the Visual Basic Editor gives you the closest possibilities. You can either “type down” (continue typing to narrow the selection) or scroll through the displayed list to fi nd the one you want. The Quick Info feature displays a ScreenTip showing syntax information about the currently selected variable, function, method, command, or sub. (Selected here just means the word in the code that’s under or adjacent to the blinking cursor insertion point.) If you type in a command like MsgBox and then press the spacebar, the ScreenTip pops up to help you complete typing in the command. The tip shows both the required and optional elements of that command. Optional elements are enclosed in square brackets. If you’re typing in actual commands from the VBA language, the easiest way to see Quick Info is just to type the command’s name and then press the spacebar key Position the insertion point in the term and choose Edit ➢ Quick Info. Position the insertion point in the command and press Ctrl+I. Right-click a VB command and choose Quick Info from the shortcut menu. Click the Quick Info icon on the Edit toolbar. Just type a space following a VB command. For example, type msgbox (space). To display Quick Info, use one of these methods:
  • 9. Auto List Members • Many VB commands have properties (qualities) and methods (behaviors). Taken together, the properties and methods of an object are called its members. The Auto List Members list allows you to quickly complete the line of code. Auto List Members is switched on by default and is automatically displayed when you type a period in an object description or a comma, parentheses, or other punctuation in a line of code. Notice in Figure 2.10 that I’ve typed in a message-box command followed by the text Hello, Marvin! and then a comma. As soon as I typed the comma, the list of settings for the Buttons appeared. (These settings are called constants.) 2 a. Press Tab, or double-click the property or method, if you want to continue adding to this line of code after entering the property or method. b. Press Enter if you want to start a new line after entering the property or method. 1 Press the down-arrow key to scroll down to the property or method, or scroll down with the mouse. You can also type the fi rst few letters of the property or method’s name to jump to it. To use Auto List Members to insert your choice into your code, follow these steps
  • 10. List Constants • The List Constants feature displays a pop-up list box containing constants for a property you’ve • typed so that you can quickly complete the expression. List Constants is switched on by default. • Alternatively, you can display the list box by clicking the List Constants button on the Edit • toolbar. 1. Type Assistant.Animation = in the Code window. 2. Press the ↓ (down-arrow) to scroll down to the constant you’re after, or type its fi rst letter (or fi rst few letters), or scroll down with the mouse. 3. Enter the constant in the code by doing the following: • Press Tab, or double-click the constant, if you want to continue working on the same line after entering the constant. • Press Enter if you want to start a new line after entering the constant.
  • 11. Setting Properties for a Project Set the project name in the Project Name text box. This name identifi es the project in the Object Browser and, when necessary, in the Windows Registry. Make sure the name is unique to avoid confusion with any other project. Enter a description of the project in the Project Description text box. This description appears in the Description pane in the Object Browser to help the user understand what the project is. So be as concise, yet descriptive, as possible. Designate the Help fi le for the project by entering the name and path of the Help fi le in the Help File Name text box. Click the button marked with the ellipsis (…) to the right of the Help File Name text box to display the Help File dialog box. Then select the fi le and click the Open button to enter the name of the Help fi le in the text box. Specify the Help context for the project in the Project Help Context ID text box. The Help context refers to a location in th e Help fi le Specify any conditional compilation arguments needed for the project. Some fi nd conditional compilation useful, but most don’t. Here’s what you can do on the General tab of the Project Properties dialog box
  • 12. Customizing the Visual Basic Editor Choose Editor and View preference settings in the Visual Basic Editor to control how it interacts with you. Choose which windows to display in the Visual Basic Editor, and organize their layout so you can use your workspace as effectively as possible. Customize the toolbar and menus in the Visual Basic Editor so the commands you need are at hand (without cluttering up your workspace). Customize the Toolbox so it contains the tools you need to build your user forms. Given how much time you’re likely to spend in the Visual Basic Editor, you ought to customize it so you can work as efficiently and comfortably as possible. You can customize it as follows:
  • 13. Choosing Editor and View Preferences Auto Syntax Check Controls whether VBA displays warning message boxes when it discovers errors while Automatically Checking Your syntax As You type Lines of code. Require Variable Declaration Governs whether you must declare variables explicitly Auto List Members Described earlier in this chapter, this option controls whether the Auto List Members and List Constants features automatically suggest properties, methods, and constants as you work in the Code window. Auto quick info this option controls whether the quick info feature automatically displays information about functions and their parameters as you work with functions in the code window. Auto Data Tips This option controls whether the Visual Basic Editor displays ScreenTips when you hover the mouse pointer over a variable or expression in Break mode, enabling you to check the value of a variable or expression quickly. Auto Indent Determines whether the Visual Basic Editor automatically indents subsequent Lines Of Code After you’ve Indented a line. When Auto Indent Switched on, The Visual Basic Editor Starts Each new line Of Code Indented to the Same Level (the Same Number Of Tabs or spaces or the Same Combination Of The two) as The Previous line.
  • 14. Tab Width Sets the number of spaces in a tab. Drag-And-Drop Text Editing Controls whether the Visual Basic Editor supports dragand-drop. Default To Full Module View Controls whether the Visual Basic Editor displays all the procedures in a module in one list (Full Module view) or displays them one at a time (Procedure view). Procedure Separator Controls whether the Visual Basic Editor displays horizontal lines to separate the procedures within a module shown in Full Module view in the Code window.
  • 15. Editor Format Page Options Normal Text Takes care of much of the text in a typical procedure. You’ll probably want to make this a conventional color (such as black, the default). Selection Text Affects the color of selected (highlighted) text. Syntax Error Text Affects the color VBA uses for offending lines. The default color is red. Execution Point Text Affects the color VBA uses for the line currently being executed in Break mode. Breakpoint Text Affects the color in which VBA displays breakpoints (points where code execution is forced to stop). Comment Text Affects the color of comment lines. The default color is dark green. Keyword Text Affects the color of keywords (words recognized as part of the VBA language). Identifi er Text Affects the color VBA uses for identifiers. Identifiers include the names of variables, constants, and procedures you define. Bookmark Text Affects the color VBA uses for the bookmarks in your code. Call Return Text Affects the color VBA uses for calls to other procedures. By default, the Visual Basic Editor uses lime green for call return text.
  • 16. General Page Options Form Grid Settings Group Box Edit and Continue Group Box Error Trapping Group Box • Break On All Errors • Break In Class Module • Break On Unhandled Errors Compile Group Box Show ToolTips and Collapse Proj. Hides Windows
  • 17. Docking Page Options The Docking page of the Options dialog box, controls whether the various windows in the Visual Basic Editor are dockable—that is, whether they snap automatically and magnetically to a side of the window when you move them there. Keeping windows dockable usually makes for a more organized interface. However, you may want to make the windows undockable so you can drag them outside the Visual Basic Editor if necessary and arrange them as you like on the screen. Contemporary monitors are becoming quite large, so you might have plenty of room to display various windows outside the primary Editor window.
  • 18. Choosing and Laying Out the Editor Windows Always make the Code window large—maximize it within the Editor. If you write long lines of code, you’ll want to have as much space in the Visual Basic Editor window as possible. That way your lines won’t wrap and the code will be easier to read. Some people fi nd that much of the time they’re actively writing code, they can dispense with the Project Explorer, displaying it only when needed. As a handy way of restoring it, you can put the Project Explorer display command on the Code window, Code window break, Watch window, Immediate window, and Locals window context menus. (You’ll learn how to customize the Editor’s menus in the next section.) You can also quickly display the Project Explorer by pressing its shortcut key, Ctrl+R.
  • 19. Customizing the Toolbar and Menu Bar There are no menus at all in Word, Excel, Access, and the other Offi ce applications. And the lone toolbar is the Quick Access Toolbar. The Ribbon replaced menus and most toolbars back in 2007. But the Visual Basic Editor retains the older interface style—no Ribbon, but instead the classic menus and toolbars, and you can customize them to a limited extent. To do this, choose View ➢ Toolbars ➢ Customize (or right-click a toolbar or the menu bar and choose Customize from the context menu).
  • 20. Customizing the Toolbox Adding Controls to the Toolbox • Right-click in the Toolbox page (not the tab itself) where you want to add controls. (You’ll learn how to add new pages to the Toolbox in the section “Adding Pages to the Toolbox” a little later in this chapter.) • Choose Additional Controls from the context menu to display the Additional Controls dialog box. • In the Available Controls list box, click the check boxes for the controls you want to add to the Toolbox, and then click the OK button.
  • 21. The Bottom Line – Open the Visual Basic Editor. When you want to create a new macro by hand-programming (as opposed to recording) or need to modify or test a macro, the Visual Basic Editor is a powerful tool. Master It Open the Visual Basic Editor in Word and create a simple macro. – Open a macro in the Visual Basic Editor. You edit and test macro code in the Code window Of the Visual Basic Editor. Master It Open the Visual Basic Editor and display a particular macro in the Code window. – Understand the Project Explorer’s two views. The Project Explorer window displays a tree of current projects. You can choose between viewing only the files or the folders and fi les. Master It Switch between folder and contents view in the Project Explorer. – Set properties for a project. You can specify a project’s name, an associated Help fi le, and other qualities of a project. Master It Lock a project so others can’t modify or even read its contents. – Customize the Visual Basic Editor. The Visual Basic Editor can be customized in many ways, including personalizing classic menus and toolbars. Master It Undock the Properties window and change its size. Then redock it.