홀덤사이트Paris Sportif CryptoTous Les Sites De Paris Sportifs BelgiqueMeilleur Casino En Ligne BelgiqueCasino Sans Documents

Entries from July 1, 2007 - July 31, 2007

Saturday
Jul142007

Simple F# interop with Visio example

A example that launches visio, creates a document, and then draws a rectangle. Nothing surprising, but useful as a starting point for automation.

 

Source Code

#r @"C:\Windows\assembly\gac\microsoft.office.interop.visio\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Visio.dll";;
let visio_app = new Microsoft.Office.Interop.Visio.ApplicationClass() ;;
let doc = visio_app.Documents.Add( "" );;
let page = doc.Pages.Item(1);;
let shape = page.DrawRectangle( 1.0, 1.0, 5.0, 4.0);;
do shape.Text <- "Hello World";;

 

Output

image

 

Notes

  • Nice to get Intellisense with F# when running in Visual Studio 2005
  • Next step is to use my "AutoVisio" assembly to make some nice drawings