title: MS Word Interop - access CentimetersToPoints method
body: <p>I am trying to set the print margins in a Word Doc I am printing from my c# application but I am having trouble accessing the methods that I need to call (based on what they are in MS Word VBA)</p>
  
  <p>In VBA the code looks like this:</p>
  
  <pre><code>Options.printBackground = False
  
  With ActiveDocument.PageSetup
      .TopMargin = CentimetersToPoints(0.61)
      .BottomMargin = CentimetersToPoints(0.43)
      .LeftMargin = CentimetersToPoints(1.27)
      .RightMargin = CentimetersToPoints(0.43)
      .Gutter = CentimetersToPoints(0)
  End With
  </code></pre>
  
  <p>Here is my c# code</p>
  
  <pre><code>oWordDoc.PageSetup.TopMargin = Microsoft.Office.Interop.Word.Application.CentimetersToPoints(float.Parse ("0.61"))  ;
  </code></pre>
  
  <p>The error I am getting is:
   <code>An object reference is required for the non-static field, method, or property 'Microsoft.Office.Interop.Word._Application.CentimetersToPoints(float)'</code></p>
  
  <p>I have tried several varaiations after searching the VS 2010 Object Browser for <em>CentimetersToPoints</em></p>
  
  <p>The available interfaces in the Object Browser are:</p>
  
  <ul>
  <li>Microsoft.Office.Interop.Word._Application.CentimetersToPoints(float)</li>
  <li>Microsoft.Office.Interop.Word.ApplicationClass.CentimetersToPoints(float)</li>
  <li>Microsoft.Office.Interop.Word._Global.CentimetersToPoints(float)</li>
  <li>Microsoft.Office.Interop.Word.GlobalClass.CentimetersToPoints(float)</li>
  </ul>
  
  <p>how can I access methods like this?</p>
  
  <p>thanks</p>