vsto + lob apps information matters

28
VSTO + LOB Apps Information Matters João Tito Lívio http://netpont o.org 26ª Reunião Lisboa - 21/01/2012

Upload: comunidade-netponto

Post on 24-May-2015

942 views

Category:

Technology


2 download

DESCRIPTION

Apresentação do João Tito Lívio sobre VSTO na 26a Reunião Presencial da Comunidade NetPonto em Lisboa (http://netponto.org).

TRANSCRIPT

Page 1: VSTO + LOB Apps Information Matters

VSTO + LOB Apps Information MattersJoão Tito Lívio

http://netponto.org26ª Reunião Lisboa - 21/01/2012

Page 3: VSTO + LOB Apps Information Matters

Patrocinador “Bronze”

Patrocinadores “Silver”

Page 4: VSTO + LOB Apps Information Matters

João Tito Lívio (aka Tito).NET e SharePoint ConsultantProject Manager

Microsoft Most Valuable Professional (Office Development)MCP + MCTS

Page 5: VSTO + LOB Apps Information Matters

Sumário• Visual Studio Tools for Office (Tool?, VBA?, Polémica? Petições? VBA will dead?, Whatever!)

– O que é– Como Funciona– Breve introdução

• Application vs Document Level• Criação de um Projecto VSTO• Tipos de Pojectos Disponíveis• Ribbon Visual Designer

• VSTO + Excel (Application Level)– Automação + SQL server– Automação + Web Services

• VSTO + Word (Document Level)– Automação + SQL server

• VSTO + Outlook– Automação com SQL Server e E-mails

Page 6: VSTO + LOB Apps Information Matters

Opiniões1. Microsoft has stopped developing Visual Basic (classic) in 1999 and has spent huge effort on

building .Net framework. since then Microsoft is promoting .Net Framework and C# as the primary language of choice. Visual Basic .Net is equally good and can used if you are already an expert in classic VB.

2. Microsoft “is planning “to retire VBA?. Office 2003 came with Scripting Engine based on Javascript (not successful) and since then promoting the use of VSTO and Office PIAs in .Net.

3. Starting Office 2007, standard formats of Excel doesn't support embedding macros. Formats that support Macros and VBA projects only run of located at Trusted locations or when security is lowered below recommended levels.

4. Starting Office 2007, the VBA environment runs in the compatibility mode and having several issues when dynamically invoking methods from the embedded VBA projects.

5. It is very clear future versions of Office will not support VBA. However, I don't know which will be the last version supporting VBA (2012, 2015?).

6. One has to seriously think about investing their time in learning VBA, when it is going away soon. It is getting very difficult to find junior VBA developers.

Source: http://www.execoder.com/2012/01/excel-development-vba-vs-vsto.html

Page 7: VSTO + LOB Apps Information Matters

VSTO o que é?

• Uma Tool para interagir com as Office App’s• Interop Object Model via .NET Components• Utiliza Managed Code (C# ou VB.NET)• Não é necessário conhecimento de VBA• Utiliza-se ao Nível da Aplicação Host ou Doc..• É interpretado como COM Component

Page 8: VSTO + LOB Apps Information Matters

Como Funciona

Object Model Call’s

Event, CallbacksMethods

Interop Assembly Microsoft Office

Microsoft Add-in

VS App

Page 9: VSTO + LOB Apps Information Matters

Application vs Document LevelA Aplicação Host Carrega o DLL O Documento Carrega o DLL

Page 10: VSTO + LOB Apps Information Matters

Tipos de Projetos VSTO

APP

DOC

São Templates criados para desenvolver projetos VSTO.

São os suportados oficialmente pela Microsoft, embora podermos criar os nossos próprios templates para qualquer aplicação Office pois os NET Interops estão disponíveis

Page 11: VSTO + LOB Apps Information Matters

Criar o Primeiro Projecto VSTO

demonstração

Page 12: VSTO + LOB Apps Information Matters

Ribbon Visual Designer

• Integração com a Application Host• Usa Callbacks para comunicar com o Office• XML Based

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject() { return new MyRibbon(); }

Page 13: VSTO + LOB Apps Information Matters

Trabalhar com a Ribbon

demonstração

Page 14: VSTO + LOB Apps Information Matters

Microsoft Excel e LOB

• Get Data from SQL server• Interop with Excel• Manage Workbooks and Worksheets

Page 15: VSTO + LOB Apps Information Matters

Excel Interop LOB

demonstração

Page 16: VSTO + LOB Apps Information Matters

Microsoft Excel e Web Services

• Get Data from Service• Interop with Excel• Display Data

Page 17: VSTO + LOB Apps Information Matters

Excel Interop Web Services

demonstração

Page 18: VSTO + LOB Apps Information Matters

Microsoft Word e LOB

• Get Data from SQL server• Interop with Word• Manage Document

Page 19: VSTO + LOB Apps Information Matters

Word Interop LOB

demonstração

Page 20: VSTO + LOB Apps Information Matters

Microsoft Outlook e LOB

• Get Data from SQL server• Interop with Outlook• Manage Outlook Actions

Page 21: VSTO + LOB Apps Information Matters

Outlook Interop LOB

demonstração

Page 22: VSTO + LOB Apps Information Matters

Deploying Visual Studio 2010 VSTO• The Microsoft .NET Framework

– Visual Studio Tools for the Office system 2010 can work with the Microsoft .NET Framework 3.5 orMicrosoft .NET Framework 4.

• The Microsoft Visual Studio 2010 Tools for Office Runtime.– Visual Studio 2010 Tools for Office Runtime provides a runtime environment that manages add-ins

and document-level solutions.

• The primary interop assemblies for the 2007 Microsoft Office system or Microsoft Office 2010.• Any utilities assemblies referenced by projects that target the .NET Framework 4.

Solution Specific Components The installer package must install the following components to the user computer:

– The Microsoft Office document, if you create a document-level solution.– The customization assembly and any assemblies it requires, Additional components such as configuration files,

The application manifest (.manifest). The deployment manifest (.vsto).– Ver: http://msdn.microsoft.com/en-us/library/ff937654#Deployment

Page 23: VSTO + LOB Apps Information Matters

Questões?

Page 24: VSTO + LOB Apps Information Matters

Referências e Links Imperdíveis• Referências: Office Developer Center

– http://msdn.microsoft.com/en-us/office/aa905340

• Vídeos Interessantes e LinksVideo: Developing Managed Applications for Office 2010 in Visual Studio 2010Video: Embedding Type Information from Microsoft Office AssembliesVideo: Copying a Document to the End User Computer after a ClickOnce InstallationVideo: Deploying Multiple Office Solutions in a Single ClickOnce Installer

• Links– Deployment Overview (Office Development in Visual Studio) – Advanced Office Solution Deployment – Preparing Computers to Run or Host Office Solutions – Updating Office Solutions – How to: Install a ClickOnce Office Solution – How to: Uninstall a ClickOnce Office Solution – Troubleshooting Office Solution Deployment

Page 25: VSTO + LOB Apps Information Matters

Patrocinadores “GOLD”

Page 26: VSTO + LOB Apps Information Matters

Patrocinador “Bronze”

Patrocinadores “Silver”

Page 27: VSTO + LOB Apps Information Matters

Próximas reuniões presenciais

• 21/01/2012 – Janeiro• 11/02/2011 – Fevereiro (Coimbra)• 18/02/2011 – Fevereiro• 24/03/2011 – Março

Reserva estes dias na agenda! :)

Page 28: VSTO + LOB Apps Information Matters

Obrigado!Contactos Sociais e Blogshttp://www.tlivio.org