Xdocument在当前上下文中不存在

时间:2015-12-19 10:10:49

标签: c# development-environment infopath2010

我正在构建一个infopath表单,我添加了一个打印作业的按钮。我有以下代码,但我收到以下错误

The name "thisXdocument" does not exist in current context.

代码:

using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Xml.XPath;
using System.Collections;
using Microsoft.Office.Interop.InfoPath.SemiTrust;
using System.Xml.Linq;
using System.Linq;

namespace SubmitPath
{
public partial class FormCode
{
public void InternalStartup()
    {
        EventManager.FormEvents.Submit += new SubmitEventHandler(FormEvents_Submit);

        ((ButtonEvent)EventManager.ControlEvents["CTRL3_5"]).Clicked += new ClickedEventHandler(CTRL3_5_Clicked);
    }
public void FormEvents_Submit(object sender, SubmitEventArgs e)
    { }
public void CTRL3_5_Clicked(object sender, ClickedEventArgs e)
    {
        thisXdocument.PrintOut();
    }
  }
}

我想打印,但我不能导致错误!

请帮帮我!

0 个答案:

没有答案