简体   繁体   English

DisplayAccountInformation Outlook VB.NET

[英]DisplayAccountInformation Outlook VB.NET

I would like to use the code from the class DipslayAccountInformation in a Windows Form project.我想在 Windows 表单项目中使用 class DipslayAccountInformation中的代码。 (link ) 链接

If I put the code directly in the event button click form the main class, I have no problems.如果我将代码直接放在主 class 的事件按钮单击窗体中,我没有问题。

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
code

But I would like to use it from the class.但我想从 class 中使用它。 How do I do that?我怎么做? How do I call the code from the class?如何从 class 调用代码?

Thanks in advance提前致谢

I want to use it as a class from the click event behind the button on my form.我想将它用作表单上按钮后面的单击事件中的 class 。 Found the answer (see below).找到了答案(见下文)。

Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim item = New Microsoft.Office.Interop.Outlook.Application Sample.DisplayAccountInformation(item) End Sub End Class Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim item = New Microsoft.Office.Interop.Outlook.Application Sample.DisplayAccountInformation(item) End Sub End Class

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM