|
3#
楼主 |
发表于 2014-3-8 01:02:59
|
只看该作者
本帖最后由 smrgh 于 2014-3-8 01:10 编辑
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
namespace WordAddIn2
{
public partial class Ribbon1
{
private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
{
}
private void button1_Click(object sender, RibbonControlEventArgs e)
{
System.Diagnostics.Process p = new System.Diagnostics.Process();//创建进程
p.StartInfo.FileName = "notepad.exe";//进程打开文件名
p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;//隐藏窗口
p.Start();//开始进程
}
private void button2_Click(object sender, RibbonControlEventArgs e)
{
if(checkBox1.Checked==true)
{
System.Diagnostics.Process.Start("http://www.office-cn.net");
}
else
try
{
System.Diagnostics.Process.Start("yy://pd-[sid=91283328&subid=2175343697]");
}
catch(System.Exception ex)
{
System.Diagnostics.Process.Start("http://yy.com/91283328/2175343697?from=");
}
}
}
}
|
|