Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.

Slides:



Advertisements
Similar presentations
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Advertisements

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
COMPREHENSIVE Word Tutorial 9 Creating On-Screen Forms Using Advanced Table Techniques.
Using Macros and Visual Basic for Applications (VBA) with Excel
Tutorial 8: Developing an Excel Application
EXCEL Spreadsheet Basics
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Using a Template to Create a Resume and Sharing a Finished Document
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Microsoft Excel 2010 Chapter 7
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Integrating Access with the Web and with Other Programs.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Pasewark & Pasewark 1 Access Lesson 4 Creating and Modifying Forms Microsoft Office 2007: Introductory.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Access Tutorial 10 Automating Tasks with Macros
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 3 Maintaining a Database
Advanced Forms Lesson 10.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
IE 411/511: Visual Programming for Industrial Applications
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 21 Fields and Forms.
Microsoft Expression Web-Illustrated Unit I: Working with Tables.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Key Applications Module Lesson 21 — Access Essentials
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Chapter 3 Automating Your Work. It is frustrating when you have to type the same passage of text repeatedly. For example your name and address. Word includes.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Chapter 2: Excel Basics and Formatting Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Chapter 7 Creating Templates, Importing Data, and Working with SmartArt, Images, and Screen Shots Microsoft Excel 2013.
1 Word Processing Intermediate Using Microsoft Office 2000.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 5 1 Microsoft Office FrontPage 2003 Tutorial 5 – Creating Tables and Frames.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Dive Into® Visual Basic 2010 Express
Excel Tutorial 8 Developing an Excel Application
Integrating Office 2003 Applications and the World Wide Web
Chapter 2 – Introduction to the Visual Studio .NET IDE
Using Procedures and Exception Handling
MODULE 7 Microsoft Access 2010
Chapter 2 – Introduction to the Visual Studio .NET IDE
Microsoft Office Access 2003
Microsoft Office Access 2003
Chapter 8 Using Document Collaboration and Integration Tools
Presentation transcript:

Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office

E Enrichment Chapter: Visual Studio Tools for Office2 Objectives ►Use Visual Studio Tools in Microsoft Word ►Create a VSTO Word template ►Add a DateTimePicker object to an application ►Add a table to a Word document

E Enrichment Chapter: Visual Studio Tools for Office3 Objectives ►Add the Actions Pane Control ►Place a ComboBox object in applications ►Calculate payments using the Pmt Function ►Use Math Class methods in mathematical computations

E Enrichment Chapter: Visual Studio Tools for Office4 Chapter Project

E Enrichment Chapter: Visual Studio Tools for Office5 Chapter Project

E Enrichment Chapter: Visual Studio Tools for Office6 Programming an Office Document ►Visual Studio Tools for Office (VSTO, pronounced “visto”) helps you build a Word document or an Excel spreadsheet that contains VB code, allowing you to create automated, customized Office documents that combine the power of Visual Basic with the familiarity of Office ►Working with Office 2003/2007 documents in VSTO is similar to working with a Visual Basic Windows application ►When you create your first VSTO application, you indicate whether you intend to create a Word or Excel document, template, or add-in. A template is a special type of Office file that determines the basic structure for a document and can hold text, styles, macros, keyboard shortcuts, custom toolbars, AutoText entries, and other settings

E VSTO Background Visual Studio Tools for Office ( VSTO ) was designed by Microsoft as a replacement for Visual Basic for Applications ( VBA ). ►VBA is a simple development environment that was integrated into all Office applications. ►VBA embedded code in every customized document which made it hard to fix bugs and update solutions because a bug would get replicated in documents across the enterprise. VisualStudio.NET and the.NET Framework provided a way to address these problems. ►The.NET Framework provides a powerful platform that Office has always provided for developers, but also solves the problems plaguing VBA of embedded code by linking a document to a.NET assembly instead of embedding the.NET assembly in the document. ►The.NET Framework also presents a new security model. VSTO 2005 SE ( second edition ) is needed in the VisualStudio 2005 environment to work with Office 2007 documents. VSTO is fully integrated into VisualStudio Enrichment Chapter: Visual Studio Tools for Office7

E 8 Creating a VSTO Project ►In the New Project dialog box, click Office in the Project types list on the left side of the window. ►In the Templates section, click Word Template. In the Name text box, type VehicleSalesContract ►VSTO can place objects on a new or existing Word document. In this example, if necessary click the Create a new document option button. Click the OK button in the Wizard window

E Enrichment Chapter: Visual Studio Tools for Office9 Creating a VSTO Project

E Enrichment Chapter: Visual Studio Tools for Office10 Understanding VSTO Toolbars and Menus Some menus, such as Tools and View, combine commands from VisualStudio and Office.

E Enrichment Chapter: Visual Studio Tools for Office11 Using the VSTO Toolbox You have access to many of the same objects in an Office project as for a Form or Web document. The.NET components are grouped in the Common Controls category of the Toolbox. There is no GroupBox container to work with RadioButtons…

E DateTimePicker Using the DateTimePicker Control The DateTimePicker control displays date and/or time information and acts as the interface through which users can modify date and time information. The control's display consists of fields that are defined by the control's format string. When the DateTimePicker is dropped down, a MonthView calendar is displayed. The control has two different modes: ►Dropdown Calendar mode (default) – enables the user to display a dropdown calendar that can be used to select a date. ►Time Format mode – enables the user to select a field in the date display (i.e. the month, day, year, etc.) and press the up/down arrow to the right of the control to set its value. Enrichment Chapter: Visual Studio Tools for Office12

E DataTimePicker ►DateTimePicker control in Dropdown Calendar Mode Enrichment Chapter: Visual Studio Tools for Office13 ►DateTimePicker control in Time Format Mode

E DateTimePicker You can use the control to display the date in various preset formats including Short Date (11/14/97), LongDate (Friday, November 14, 1997) and Time (7:00:00 PM). You can also specify custom formats using formatting strings, or create your own formats with. Possible Uses: ►To present date information where a restricted or specially formatted field is required, such as in a payroll or scheduling application. ►To give users the ability to select a date with the click of a mouse instead of typing a date value. The currently selected date in the control is determined by the Value property. You can set the Value of the control before it is displayed (for example, at design time or in the Form_Load event) to determine which date will be initially selected in the control: DTPicker1.Value = "10/31/97" By default, the control's Value is set to the current date. If you change the DateTimePicker's Value in code, the control is automatically updated to reflect the new setting. The Value property returns a raw date value, or a null value. The DateTimePicker control has several properties that return specific information about the displayed date: ►The Month property returns the integer value (1-12) of the month containing the currently selected date. ►The Day property returns the day number (1-31) currently selected. ►The DayOfWeek property returns a value indicating the day of the week the selected date falls on (values correspond to the values of vbDayOfWeek constants.) ►The Year property returns the year containing the selected date as an integer value. ►The Week property returns the number of the week containing the selected date. Enrichment Chapter: Visual Studio Tools for Office14

E Enrichment Chapter: Visual Studio Tools for Office15 Adding a DateTimePicker Object ►The DateTimePicker object allows the user to select one date from a calendar of dates or times ►Similar to Calendar Web Tool

E Enrichment Chapter: Visual Studio Tools for Office16 Adding a DateTimePicker Object

E Enrichment Chapter: Visual Studio Tools for Office17 Adding a Table to a Word Document ►Click the Insert Table button on the Word Standard toolbar ►Drag to select one row and three columns in the grid ►Release the mouse button to insert the table in the Word template

E Enrichment Chapter: Visual Studio Tools for Office18 Inserting a Picture and Additional Cells into the Table ►Click the leftmost cell in the table. Click Insert on the menu bar, point to Picture on the Insert menu, and then click From File. In the Insert Picture dialog box, locate the car.jpg image file where you saved it. Select the car.jpg image and then click the Insert button to place the image in the table [ Word picture versus VB PictureBox … ] ►The second and third columns contain one row. To add rows to these columns, first drag across the second and third columns to select them ►Click Table on the menu bar and then click Split Cells on the Table menu ►In the Split Cells dialog box, use the arrows to set the value in the Number of columns list to 2 and the value in the Number of rows list to 6. Click the OK button in the Split Cells dialog box. Click outside the table

E Enrichment Chapter: Visual Studio Tools for Office19 Inserting a Picture and Additional Cells in the Table

E Enrichment Chapter: Visual Studio Tools for Office20 Using AutoFormat to Format a Table ►Click anywhere in the table ►Click Table on the menu bar and then click Table AutoFormat. ►When the Table AutoFormat dialog box opens, click the Table Columns 1 table style. ►At the bottom of the dialog box, uncheck the Heading Rows, First Column, Last Row, and Last Column boxes in the Apply special formats to section ►Click the Apply Button

E Enrichment Chapter: Visual Studio Tools for Office21 Using AutoFormat to Format a Table

E Enrichment Chapter: Visual Studio Tools for Office22 Adding the Actions Pane Control ►The Actions Pane Control is a customizable task pane that appears in the Office application window ►Using VSTO, you can create a customized Actions Pane Control called the Document Actions task pane ►The ActionsPane object acts as a container for Visual Basic objects

E Enrichment Chapter: Visual Studio Tools for Office23 Adding the Actions Pane Control Procedure 1 of 2 ►Open the code window by clicking the View Code button on the Solution Explorer toolbar. ►Click inside the ThisDocument_Startup event ►Type me.ActionsPane.Controls.Add(New DateTimePicker) ►Press the ENTER key and then delete the blank line ►Test the application by clicking the Start Debugging button on the Standard toolbar

E Enrichment Chapter: Visual Studio Tools for Office24 Adding the Actions Pane Control

E Enrichment Chapter: Visual Studio Tools for Office25 Adding the Actions Pane Control Procedure 2 of 2 ►Click Project on the menu bar ►click Add New Item to the Project ►Click Actions Pane Control ►Click the Add button in the Add New Item dialog box

E Enrichment Chapter: Visual Studio Tools for Office26 Adding the Actions Pane Control ►Drag a Label object from the Toolbox to the Actions Pane Control. Change the (Name) property of the Label object to lblCalculator. ►Change the Text property to Loan Calculator, and the Font property to Sans Serif, size 12 ►To display the Actions Pane Control when the application runs, you must code a request to view the Document Actions task pane that is executed when the Word document opens. ►Click the ContractDocument.vb tab to open the code window for the Word template. ►Click in the ThisDocument_Startup event, type me.ActionsPane.Controls.Add(New ActionsPaneControl1) which opens the Actions Pane Control when the application begins ►Click the Start Debugging button on the Standard toolbar to execute the application. Microsoft Word opens with the Document Actions task pane on the right side of the window

E Enrichment Chapter: Visual Studio Tools for Office27 Adding the Actions Pane Control

E Enrichment Chapter: Visual Studio Tools for Office28 Using a ComboBox Object The combo box is used to select a value for the number of months for a loan. The user can also type in a value in the text field of the combo box rather than selecting one of the supplied values.

E Enrichment Chapter: Visual Studio Tools for Office29 Calculating Loan Payments with the Pmt Function

E Enrichment Chapter: Visual Studio Tools for Office30 Calculating Loan Payments with the Pmt Function Calculate a monthly payment Monthly Amount = $ Total Paid = $22, Calculate a payment amount to yield a future value. Payment Amount = $ Total of payments = $21,468.00

E Enrichment Chapter: Visual Studio Tools for Office31 Calculating with the Math Class

E Enrichment Chapter: Visual Studio Tools for Office32 Calculating with the Math Class

E Enrichment Chapter: Visual Studio Tools for Office33 Program Design

E Enrichment Chapter: Visual Studio Tools for Office34 Program Design

E Enrichment Chapter: Visual Studio Tools for Office35 Design the Program Processing Objects

E Enrichment Chapter: Visual Studio Tools for Office36 Summary ►Use Visual Studio Tools in Microsoft Word ►Create a VSTO Word template ►Add a DateTimePicker object to an application ►Add a table to a Word document

E Enrichment Chapter: Visual Studio Tools for Office37 Summary ►Add the Actions Pane Control ►Place a ComboBox object in applications ►Calculate payments using the Pmt Function ►Use Math Class methods in mathematical computations

Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office