1 / 38

Visual Studio Tools for Office

Voor VBA programmeurs Maurice de Beijer. Visual Studio Tools for Office. Wie ben ik?. Maurice de Beijer. The Problem Solver. Visual Basic MVP. Blog: http://msmvps.com/blogs/ theproblemsolver /default.aspx Web: http://www.TheProblemSolver.nl http://www.WindowsWorkflowFoundation.eu

Download Presentation

Visual Studio Tools for Office

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Voor VBA programmeurs Maurice de Beijer Visual Studio Tools for Office

  2. Wie ben ik? • Maurice de Beijer. • The Problem Solver. • Visual Basic MVP. • Blog: http://msmvps.com/blogs/theproblemsolver/default.aspx • Web: http://www.TheProblemSolver.nlhttp://www.WindowsWorkflowFoundation.eu • E-mail: mauricedb@computer.org

  3. Mijn assistent

  4. VBA isn’t going away anytime soon. Richard McAniff Corporate Vice President Microsoft Office

  5. Agenda • Wat is .NET? • Wat is Visual Studio Tools for Office? • De Ribbon met VSTO/VBA. • CustomTaskPanes en ActionsPane. • Outlook FormRegions. • VSTO en VBA Interoperability. • LINQ to SQL. • Deployment. • Resources

  6. Wat is .NET? • CommonLanguageInfrastructure (CLI). • Is een ECMA standaard. • CommonLanguageRuntime (CLR). • De Microsoft implementatie. • Microsoft IntermediateLanguage (MSIL). • Is ook een ECMA standaard. • Memorygarbagecollection. • Code accesssecurity.

  7. Wat is .NET? • Applicatie framework: • Windows applicaties. • Web applicaties. • Mobile devices. • Office applicaties. • Taal onafhankelijk: • Visual Basic. • C#. • Fujitsu Cobol.NET. • IronPython. • Meer dan 200Mb aan DLL’s!

  8. Visual Studio 2008

  9. Wat is Visual Studio Tools for Office? • Een toolkit binnen Visual Studio. • Een runtime binnen Office 2003 en 2007. • Kan met Visual Basic of C# gebruikt worden.

  10. VSTO versies

  11. De Ribbon met VSTO Ribbon Designer Property Grid Ribbon Control Toolbox

  12. De Ribbon met VSTO • Via de designer of met XML. • Via XML geeft meer mogelijkheden. • Update ToggleButton status. • In XML is er een getPressed. • Via de designer met een timer of een ander event.

  13. De Ribbon met VSTO

  14. De Ribbon met VBA

  15. De Ribbon met VBA • Gebruik de gratis Office 2007 Custom UI Editor! • De Ribbon XML wordt in het Office document gestopt. • In het XML staan functie namen van VBA macro’s in het document zelf. • Dus maar 1 bestand verspreiden!

  16. De Ribbon met VBA

  17. Druk aan het werk?

  18. Wie kent deze tekstverwerker?

  19. Of misschien toch niet!

  20. CustomTaskPanes

  21. CustomTaskPanes • Onderdeel van een applicatie Add-in. • Aanwezig zodra de applicatie opgestart wordt. • Is een collectie van CustomTaskPane objecten. • Werkt in de meeste Office applicaties. • Behalve Outlook en OneNote.

  22. CustomTaskPanes

  23. ActionsPane

  24. ActionsPane • Onderdeel van een Office document. • Is een wrapper rond een UserControl. • Application.DisplayDocumentActionTaskPane om de ActionsPane (on)zichtbaar te maken. • Gebruik een System.Windows.Forms.Integration.ElementHost om WPF controls te gebruiken. • Werkt in Excel en Word.

  25. ActionsPane

  26. Outlook FormRegions voor onze nieuwe manager

  27. Outlook FormRegions • NewMailExevent geeft aan wanneer er nieuwe mail is. • In Outlook 2007 altijd een event per ontvangen mail item. • Is niet 100% betrouwbaar bij grote aantallen en pop3! • Outlook formregions. • Altijd een combinatie van een FormRegion en een FormRegionFactory. • De FormRegion wordt steeds opnieuw gemaakt. • In de factoryclass kan je bepalen of een formregion zichtbaar moet worden of niet.

  28. Outlook FormRegions

  29. VSTO en VBA Interoperability • Vanuit .NET code kan een VBA macro aangeroepen worden met Application.Run(). • Vanuit VBA kaneen .NET functieaangeroepenworden via de CallVSTOAssemby property. • Altijdbeginnen met een macro enabled document! • De EnableVbaCallers property op True zettenvoor VBA => VSTO.

  30. Property enables code to be called from VBA Intellisense for VBA-callable components

  31. VSTO en VBA interop

  32. LINQ to SQL • LanguageIntergrated Query. • Het lijkt op SQL maar de compiler controleert de syntax en tabel/kolom namen. • Niet alleen voor databases maar ook XML of andere collecties.

  33. LINQ to SQL

  34. Deployment • Is sterk verbeterd t.o.v. VSTO 2005! • Met Office 2007 heel makkelijk. • ClickOncedeployment: • Prerequisites. • CasPol. • Automatische updates.

  35. Deployment

  36. Resources • Office 2007 Custom UI Editorhttp://openxmldeveloper.org/articles/CustomUIeditor.aspxhttp://msdn2.microsoft.com/en-us/aa338202.aspx • http://www.outlookcode.com • OutlookSpyhttp://www.dimastr.com/outspy/ • Synchroniseren van de Ribbon met een CustomTaskPane in Word 2007http://www.sdn.nl/Display.aspx?id=2525

  37. Resources • 2007 Office System Document: Lists of Control Ids http://www.microsoft.com/downloads/details.aspx?familyid=4329d9e9-4d11-46a5-898d-23e4f331e9ae&displaylang=en

  38. Vragen? mauricedb@computer.org

More Related