Visual studio tools for office 2007

1.1K 196 0
Visual studio tools for office 2007

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

www.it-ebooks.info Praise for Visual Studio Tools for Office 2007 “Visual Studio Tools for Office has always been one of my favorite technologies to come out of Microsoft There are millions of people who use Office applications all day, every day; with VSTO, you can create applications for them Eric Carter and Eric Lippert helped create VSTO, so they know as much about it as anybody, making this book a must-have After reading it, you’ll know everything needed to begin building solutions that take advantage of the NET Framework features, in the UI your users are familiar with.” —Robert Green, senior consultant, MCW Technologies “With the application development community so focused on the Smart Client revolution, a book that covers VSTO from A to Z is both important and necessary This book lives up to big expectations It is thorough, has tons of example code, and covers Office programming in general terms—topics that can be foreign to the seasoned NET developer who has focused on ASP.NET applications for years Congratulations to Eric Lippert and Eric Carter for such a valuable work!” —Tim Huckaby, CEO, InterKnowlogy; Microsoft Regional Director “Eric Carter and Eric Lippert really get it Professional programmers will love the rich power of Visual Studio and NET, along with the ability to tap into Office programmability This book walks you through programming Excel, Word, and Outlook solutions.” —Vernon W Hui, test lead, Microsoft Corporation “This book is both a learning tool and a reference book, with a richness of tables containing object model objects and their properties, methods, and events I would recommend it to anyone considering doing Office development using the NET Framework; especially people interested in VSTO programming.” —Rufus Littlefield, software design engineer/tester, Microsoft Corporation “This book will help Office NET Developers optimize their work It goes beyond providing an introduction to VSTO and the object models of Word, Excel, and Outlook The overview of other technologies available for interacting with Office assist in analyzing how to best approach any Office project In addition, the authors’ insights into the design of this RAD tool make it possible to get the most out of VSTO applications.” —Cindy Meister, Microsoft MVP for VSTO, author of Word Programmierung, Das Handbuch www.it-ebooks.info “This book is an in-depth, expert, and definitive guide to programming using Visual Studio Tools for Office 2007 It is a must-have book for anyone doing Office development.” —Siew Moi Khor, programmer/writer, Microsoft Corporation “We don’t buy technical books for light reading, we buy them as a resource for developing a solution This book is an excellent resource for someone getting started with Smart Client development For example, it is common to hear a comment along the lines of, ‘It is easy to manipulate the Task Pane in Office 2007 using VSTO 2008,’ but until you see something like the example at the start of Chapter 14, it is hard to put ‘easy’ into perspective “This is a thorough book that covers everything from calling Office applications from your application, to building applications that are Smart Documents It allows the traditional Windows developer to really leverage the power of Office 2007.” —Bill Sheldon, principal engineer, InterKnowlogy; MVP “Eric Carter and Eric Lippert have been the driving force behind Office development and Visual Studio Tools for Office The depth of their knowledge and understanding of VSTO and Office is evident in this book Professional developers architecting enterprise solutions using VSTO 2008 and Office system 2007 now have a new weapon in their technical arsenal.” —Paul Stubbs, program manager, Microsoft Corporation “This book, also known as ‘The Bible of VSTO,’ has been rewritten for Office 2007 and I was delighted to read the sections on new VSTO features that were added in Visual Studio 2008 It explains how the VSTO team hid the plumbing and cumbersome coding tasks to allow you to be more productive and to just create excellent business applications New or experienced in Office development, you will want to add this book to your library!” —Maarten van Stam, Microsoft MVP, Visual Developer, VSTO, http://blogs.officezealot.com/maarten “This book covers all of the ins and outs of programming with Visual Studio Tools for Office in a clear and concise way Given the authors’ exhaustive experiences with this subject, you can’t get a more authoritative description of VSTO than this book!” —Paul Vick, principal architect, Microsoft Corporation www.it-ebooks.info Visual Studio Tools for Office 2007 www.it-ebooks.info Microsoft NET Development Series John Montgomery, Series Advisor • Don Box, Series Advisor • Brad Abrams, Series Advisor The award-winning Microsoft NET Development Series was established in 2002 to provide professional developers with the most comprehensive and practical coverage of the latest NET technologies It is supported and developed by the leaders and experts of Microsoft development technologies, including Microsoft architects, MVPs, and leading industry luminaries Books in this series provide a core resource of information and understanding every developer needs to write effective applications Titles in the Series Brad Abrams, NET Framework Standard Library Annotated Reference Volume 1: Base Class Library and Extended Numerics Library, 978-0-321-15489-7 Brad Abrams and Tamara Abrams, NET Framework Standard Library Annotated Reference, Volume 2: Networking Library, Reflection Library, and XML Library, 978-0-321-19445-9 Chris Anderson, Essential Windows Presentation Foundation (WPF), 978-0-321-37447-9 Mark Michaelis, Essential C# 3.0: For NET Framework 3.5, 978-0-321-53392-0 James S Miller and Susann Ragsdale, The Common Language Infrastructure Annotated Standard, 978-0-321-15493-4 Christian Nagel, Enterprise Services with the NET Framework: Developing Distributed Business Solutions with NET Enterprise Services, 978-0-321-24673-8 Bob Beauchemin and Dan Sullivan, A Developer’s Guide to SQL Server 2005, 978-0-321-38218-4 Brian Noyes, Data Binding with Windows Forms 2.0: Programming Smart Client Data Applications with NET, 978-0-321-26892-1 Adam Calderon, Joel Rumerman, Advanced ASP.NET AJAX Server Controls: For NET Framework 3.5, 978-0-321-51444-8 Brian Noyes, Smart Client Deployment with ClickOnce: Deploying Windows Forms Applications with ClickOnce, 978-0-321-19769-6 Charlie Calvert and Dinesh Kulkarni, Essential LINQ, 978-0-321-56416-0 Fritz Onion with Keith Brown, Essential ASP.NET 2.0, 978-0-321-23770-5 Eric Carter and Eric Lippert, Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook, 978-0-321-33488-6 Steve Resnick, Richard Crane, Chris Bowen, Essential Windows Communication Foundation: For NET Framework 3.5, 978-0-321-44006-8 Eric Carter and Eric Lippert, Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath, 978-0-321-33488-6 Eric Carter and Eric Lippert, Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath, 978-0-321-41175-4 Steve Cook, Gareth Jones, Stuart Kent, Alan Cameron Wills, Domain-Specific Development with Visual Studio DSL Tools, 978-0-321-39820-8 Krzysztof Cwalina and Brad Abrams, Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable NET Libraries, Second Edition, 978-0-321-54561-9 Scott Roberts and Hagen Green, Designing Forms for Microsoft Office InfoPath and Forms Services 2007, 978-0-321-41059-7 Neil Roodyn, eXtreme NET: Introducing eXtreme Programming Techniques to NET Developers, 978-0-321-30363-9 Chris Sells and Michael Weinhardt, Windows Forms 2.0 Programming, 978-0-321-26796-2 Dharma Shukla and Bob Schmidt, Essential Windows Workflow Foundation, 978-0-321-39983-0 Joe Duffy, Concurrent Programming on Windows, 978-0-321-43482-1 Guy Smith-Ferrier, NET Internationalization: The Developer’s Guide to Building Global Windows and Web Applications, 978-0-321-34138-9 Sam Guckenheimer and Juan J Perez, Software Engineering with Microsoft Visual Studio Team System, 978-0-321-27872-2 Will Stott and James Newkirk, Visual Studio Team System: Better Software Development for Agile Teams, 978-0-321-41850-0 Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, Peter Golde, The C# Programming Language, Third Edition, 978-0-321-56299-9 Paul Yao and David Durant, NET Compact Framework Programming with C#, 978-0-321-17403-1 Alex Homer and Dave Sussman, ASP.NET 2.0 Illustrated, 978-0-321-41834-0 Paul Yao and David Durant, NET Compact Framework Programming with Visual Basic NET, 978-0-321-17404-8 Joe Kaplan and Ryan Dunn, The NET Developer’s Guide to Directory Services Programming, 978-0-321-35017-6 For more information go to informit.com/msdotnetseries/ www.it-ebooks.info Download from www.wowebook.com Visual Studio Tools for Office 2007 VSTO for Excel, Word, and Outlook Eric Carter Eric Lippert Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City www.it-ebooks.info Download from www.wowebook.com Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The NET logo is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries and is used under license from Microsoft The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests For more information, please contact: U.S Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact: International Sales international@pearson.com Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Carter, Eric Visual Studio tools for Office 2007 : VSTO for Excel, Word, and Outlook / Eric Carter, Eric Lippert — 2nd ed p cm Includes bibliographical references and index ISBN 978-0-321-53321-0 (pbk : alk paper) Microsoft Visual BASIC BASIC (Computer program language) Microsoft Visual studio Microsoft Office I Lippert, Eric II Title QA76.73.B3C3452 2009 005.13'3—dc22 Copyright © 2009 Pearson Education, Inc 2009000638 All rights reserved Printed in the United States of America This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise For information regarding permissions, write to: Pearson Education, Inc Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671-3447 ISBN-13: 978-0-321-53321-0 ISBN-10: 0-321-53321-6 Text printed in the United States on recycled paper at Courier in Stoughton, Massachusetts First printing, February 2009 www.it-ebooks.info Download from www.wowebook.com To my wife, Tamsyn, and our children Jason, Hayley, Camilla, Rand, Elizabeth, and Miles —Eric Carter To Leah Lippert, for embarking with me on a fabulous adventure And to David Lippert, who taught me to expect the unexpected along the way —Eric Lippert www.it-ebooks.info Download from www.wowebook.com This page intentionally left blank www.it-ebooks.info Download from www.wowebook.com Contents at a Glance Contents xi Figures xxxi Tables xlv Foreword li Preface lv Acknowledgments lix About the Authors lxi PART I An Introduction to VSTO An Introduction to Office Programming Introduction to Office Solutions 51 PART II Office Programming in NET Programming Excel 87 89 Working with Excel Events 115 Working with Excel Objects 163 Programming Word 243 Working with Word Events 267 Working with Word Objects 311 Programming Outlook 405 www.it-ebooks.info ix Download from www.wowebook.com –‡ ƒ‹Ž –‡ ʰ ‹–‡ ƒ• —–Ž‘‘Ŝƒ‹Ž –‡Ś ‹ˆ ſƒ‹Ž –‡ Šʰ —ŽŽƀ Ƈ ‡••ƒ‰‡ ‘šŜŠ‘™ſ–”‹‰Ŝ ‘”ƒ–ſ ɑƒ‹Ž –‡ Ƈɥƈ ™ƒ• Œ—•– ƇɨƈŜɑř ƒ‹Ž –‡Ŝ—„Œ‡…–ř ‘’‡”ƒ–‹‘ƀƀŚ ƈ ‡Ž•‡ Ƈ ‡••ƒ‰‡ ‘šŜŠ‘™ſ–”‹‰Ŝ ‘”ƒ–ſ ɑ  —–Ž‘‘ ‹–‡ ™ƒ• Œ—•– ƇɥƈŜɑř ‘’‡”ƒ–‹‘ƀƀŚ ƈ ƈ ˜‘‹† ‘Ž†‡”ɏ ‡ˆ‘”‡ –‡‘˜‡ſ‘„Œ‡…– –‡ř —–Ž‘‘Ŝ  ‘Ž†‡” ‘˜‡‘ř ”‡ˆ „‘‘Ž ƒ…‡Žƀ Ƈ —–Ž‘‘Ŝƒ‹Ž –‡ ƒ‹Ž –‡ ʰ –‡ ƒ• —–Ž‘‘Ŝƒ‹Ž –‡Ś ‹ˆ ſƒ‹Ž –‡ Šʰ —ŽŽƀ Ƈ ‡••ƒ‰‡ ‘šŜŠ‘™ſ–”‹‰Ŝ ‘”ƒ–ſ ɑ”‡˜‡–‹‰ ‘˜‡ Ƈɥƈ –‘ ˆ‘Ž†‡” ƇɨƈŜɑř ƒ‹Ž –‡Ŝ—„Œ‡…–ř ‘˜‡‘Ŝƒ‡ƀƀŚ ƒ…‡Ž ʰ –”—‡Ś ƈ ƈ ɤ”‡‰‹‘  ‰‡‡”ƒ–‡† …‘†‡ ’”‹˜ƒ–‡ ˜‘‹† ...Praise for Visual Studio Tools for Office 2007 Visual Studio Tools for Office has always been one of my favorite technologies to come out of Microsoft There are millions of people who use Office. .. Eric Lippert, Visual Studio Tools for Office: Using C# with Excel, Word, Outlook, and InfoPath, 978-0-321-33488-6 Eric Carter and Eric Lippert, Visual Studio Tools for Office: Using Visual Basic... Prerequisites 956 Office 2007 956 Windows Installer 3.1 956 NET Framework 3.5 SP1 or NET Framework Client Profile 957 Microsoft Office 2007 Primary Interop Assemblies 957 Visual Studio Tools for the Office

Ngày đăng: 27/03/2019, 16:12

Từ khóa liên quan

Mục lục

  • Contents

  • Figures

  • Tables

  • Foreword

  • Preface

  • Acknowledgments

  • About the Authors

  • PART I: An Introduction to VSTO

    • 1 An Introduction to Office Programming

      • Why Office Programming?

      • Office Business Applications

      • Office Object Models

      • Properties, Methods, and Events

      • The Office Primary Interop Assemblies (PIAs)

      • Conclusion

      • 2 Introduction to Office Solutions

        • The Three Basic Patterns of Office Solutions

        • Office Automation Executables

        • Office Add-Ins

        • Code Behind a Document

        • Conclusion

        • PART II: Office Programming in .NET

          • 3 Programming Excel

            • Ways to Customize Excel

            • Programming User-Defined Functions

Tài liệu cùng người dùng

Tài liệu liên quan