Вы можете использовать метод InchesToPoints объекта Word Application следующим образом:
Word.Application wrdApplication = new Word.Application();
Word.Document wrdDocument;
wrdApplication.Visible = true;
wrdDocument = wrdApplication.Documents.Add();
wrdDocument.PageSetup.Orientation = Word.WdOrientation.wdOrientLandscape;
wrdDocument.PageSetup.TopMargin = wrdApplication.InchesToPoints(0.5f);
wrdDocument.PageSetup.BottomMargin = wrdApplication.InchesToPoints(0.5f);
wrdDocument.PageSetup.LeftMargin = wrdApplication.InchesToPoints(0.5f);
wrdDocument.PageSetup.RightMargin = wrdApplication.InchesToPoints(0.5f);
Или, если хотите, можете сделать свой собственный ...
private float InchesToPoints(float fInches)
{
return fInches * 72.0f;
}
Это можно использовать примерно так:
Word.Application wrdApplication = new Word.Application();
Word.Document wrdDocument;
wrdDocument = wrdApplication.Documents.Add();
wrdDocument.PageSetup.Orientation = Word.WdOrientation.wdOrientLandscape;
wrdDocument.PageSetup.TopMargin = InchesToPoints(0.5f); //half an inch in points
wrdDocument.PageSetup.BottomMargin = InchesToPoints(0.5f);
wrdDocument.PageSetup.LeftMargin = InchesToPoints(0.5f);
wrdDocument.PageSetup.RightMargin = InchesToPoints(0.5f);
wrdApplication.Visible = true;
Word использует 72 точки на дюйм в интервале.