daniel sanders

daniel sanders

  • NA
  • 5
  • 2.3k

Using directive doesn't work

Jun 29 2011 5:22 AM

Hey guys,

In my Forms class i have the following "Using" statements:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop;using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop;

In my class I use the following code:

public void DrawSampleShapeConnection()
        {

            // get the current draw page
            Visio.Page currentPage = VisioPane.Document.Pages[1];
        }

But this doesnt work, the compiler gives an error on Visio:
The type or namespace name 'Visio' could not be found (are you missing a using directive or an assembly reference?
I've tried the following and that does work:

 public void DrawSampleShapeConnection()
        {

            // get the current draw page
            Microsoft.Office.Interop.Visio.Page currentPage = VisioPane.Document.Pages[1];
        }

I don't understand why the compiler won't take my reference.


Any help is very much appreciated.


Kind regards,
Daniel

EDIT: Past code with IE9 is not advised.... Chrome works better

Answers (3)