_ExternalApplication.CacheSolution(String) 方法

定义

检查缓存中的表单模板,如果需要,从表单模板的发布位置更新该模板。

public:
 void CacheSolution(System::String ^ bstrSolutionURI);
public void CacheSolution (string bstrSolutionURI);
abstract member CacheSolution : string -> unit
Public Sub CacheSolution (bstrSolutionURI As String)

参数

bstrSolutionURI
String

该字符串值指定表单模板的统一资源标识符 (URI)。 可以将此参数指定为表单定义 (.xsf) 文件或表单模板 (.xsn) 文件。

示例

在以下示例(用 C# 编程语言编写)中,对象的 CacheSolution 方法 ExternalApplication 用于缓存 InfoPath 表单模板

private void AutomateInfoPathForm()
{
ExternalApplication infoPath = new ExternalApplicationClass();

 // Cache an InfoPath form template.
infoPath.<span class="label">CacheSolution</span>(@"\\MyServer\MyForms\MyForm.xsn");
}

注意:上述示例假定 Microsoft.Office.Interop.InfoPath 正在使用命名空间,并且引用了 Microsoft InfoPath 3.0 类型库。

在以下示例(用 C# 编程语言编写)中,对象的 CacheSolution 方法 ExternalApplication 用于缓存 InfoPath 表单模板

private void AutomateInfoPathForm()
{
ExternalApplication infoPath = new ExternalApplicationClass();

 // Cache an InfoPath form template.
infoPath.<span class="label">CacheSolution</span>(@"\\MyServer\MyForms\MyForm.xsn");
}

注意:上述示例假定 Microsoft.Office.Interop.InfoPath 正在使用命名空间,并且引用了 Microsoft InfoPath 3.0 类型库。

注解

如果当前在缓存中存在的表单模板与发布位置的表单模板匹配,则不会发生缓存操作。 如果计算机处于脱机状态且表单已位于缓存中,则保留缓存且不进行更新。

适用于