Show All

# CacheSolution Method (ExternalApplication Object)

Examines the form template in the cache and, if necessary, updates it from the published location of the form template.

expression.CacheSolution(ByVal bstrSolutionURI As String)

expression Required. An expression that returns a reference to the ExternalApplication object.

bstrSolutionURI Required String. The string value that specifies the Uniform Resource Identifier (URI) of the form template. This parameter can be specified as a form definition (.xsf) file or a form template (.xsn) file

## Security Level

3: Can be accessed only by fully trusted forms.

## Remarks

If the form template that currently exists in the cache matches the form template from the published location, no caching takes place. If the computer is offline and the form is already in the cache, the cache is kept and no update will occur.

## Example

In the following example, which is written in the Visual Basic for Applications (VBA) programming language, the CacheSolution method of the ExternalApplication object is used to cache a form template:

    Public Sub CacheFormTemplate()

       Dim I As Integer
       Dim objExternalApp As Object
       Dim aryForms(2) As String

       'Create a reference to the ExternalApplication object.
       Set objExternalApp = CreateObject("InfoPath.ExternalApplication")

       'Populate the array with form template locations.
       aryForms(0) = "\\MyServer\MyForms\MyForm.xsn"
       aryForms(1) = "\\MyServer\MyForms\manifest.xsf"

       'Loop through the array and cache the form templates.
       For I = 0 To UBound(aryForms) - 1
          objExternalApp.CacheSolution(aryForms(I))
       Next I

    End Sub

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp