Solid Edge Framework Type Library
OpenWithTemplate Method
Specifies the name of the file.
Specifies the name of the template.
Description
Opens a specified document with a specified template.
Syntax
Visual Basic
Public Function OpenWithTemplate( _
   ByVal Filename As String, _
   ByVal Template As String, _
   Optional ByVal RecognizeFeaturesIfPartTemplate As Variant _
) As Object
Parameters
Filename
Specifies the name of the file.
Template
Specifies the name of the template.
RecognizeFeaturesIfPartTemplate
Example
Private Sub Form_Load()
    Dim objApp As SolidEdgeFramework.Application
    Dim objDoc As SolidEdgePart.PartDocument
    Dim objDocuments As SolidEdgeFramework.Documents
    Dim strFileName As String
    Dim strTemplate As String
    ' Report errors
    Const PI = 3.14159265358979
    ' Create/get the application with specific settings
    On Error Resume Next
    Set objApp = GetObject(, "SolidEdge.Application")
    If Err Then
        Err.Clear
        Set objApp = CreateObject("SolidEdge.Application")
        Set objDoc = objApp.Documents.Add("SolidEdge.PartDocument")
        objApp.Visible = True
    Else
        Set objDoc = objApp.ActiveDocument
    End If
    objDoc.Close
    'Get the Documents collection
    Set objDocuments = objApp.Documents
    strFileName = "T:\vbtests\TestCases\ems032_0.x_t"
    strTemplate = "T:\vbtests\TestCases\normeng.par"
    'Open a non-native SoldEdge file with specified template
    Set objDoc = objDocuments.OpenWithTemplate(Filename:=strFileName, TEMPLATE:=strTemplate)
    ' USER DISPLAY
    ' Release objects
    Set objApp = Nothing
    Set objDoc = Nothing
    Set objDocuments = Nothing
End Sub
See Also

Documents Collection  | Documents Members