且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何设置Microsoft word应用程序高度&使用interop C#的宽度

更新时间:2023-02-15 10:57:19

Microsoft.Office.Interop.Word.Application wordApp = new
Microsoft.Office.Interop.Word.Application();
wordApp.Visible = true;

 d = wordApp.Documents;
 aDoc = d.Open(ref oFilename, ref nil, ref readOnly, ref nil,
    ref nil, ref nil, ref nil, ref nil, ref nil, ref nil, ref nil,
        ref isVisible, ref nil, ref nil, ref nil, ref nil);





使用此代码移动和更改Word窗口的大小:

将Microsoft字词底部设置为等于应用程序的顶部位置



For moving and change size of the Word window using this code:
set Microsoft word bottom equal to the top position of application

aDoc.Activate();

aDoc.Application.Width = this.Width;
aDoc.Application.Height = this.Height;

aDoc.Application.Move(this.Left, this.Top);