<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<!--Created: 18.05.2017 11:54:07-->
<!--ACTOptimumVersion: 6.0.6282.19592-->
<AutoDataItems ACTOptimumVersion="6.0.6282.19592" Created="18.05.2017 11:54:07">
    <AutoDataControl Created="18.05.2017 11:54:07" ClassName="Melville_Schellmann.ACTOptimum3.Control.AutoData3.AutoData3" PrefClassVersion="1.0" ACTOptimumVersion="6.0.6282.19592">
        <Source>' #ScriptName: CreateLetterFromTemplate
    ' #Description: Erstellt einen Brief aus einer festgelgeten Wordvorlagendatei (*.ADT)
    ' #Author: Robert Schellmann, rs@melville-schellmann.de
    ' #Copyright: © 2011 by Melville-Schellmann
    ' #Version: 1.0 (28.03.2011) 

    Dim sPath As String
    Dim sDoc As String
    Dim sScriptName As String

    sDoc = "Letter.adt" 'Name der Vorlgendatei im Ordner "Templates"

    sScriptName = "Erstelle Brief aus Vorlage"
    sPath = ACTApp.ActFramework.SupplementalFileManager.Workgroup.Path &amp; "\Templates" &amp; "\" &amp; sDoc
    If Not System.IO.File.Exists(sPath) Then
      MsgBox(String.Format("Es konnte nicht die Vorlage '{0}' gefunden werden.", sPath), MsgBoxStyle.Information, sScriptName)
      GoTo Abbruch
    End If

    ' Reflection-Aufruf von ACTApp.Explorer.CustomCommandHelper.CustomCommandHandler(sPath)

    Dim oCustomCommandHelper As Object
    Dim oProperty As System.Reflection.PropertyInfo
    Dim sProperty As String
    Dim oMethod As System.Reflection.MethodInfo
    Dim sMethod As String
    Dim aParameter(0) As Object
    
    sProperty = "CustomCommandHelper"
    sMethod = "CustomCommandHandler"
    oProperty = ACTApp.Explorer.GetType.GetProperty(sProperty, Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance)
    If oProperty Is Nothing Then
      MsgBox(String.Format("Die Eigenschaft '{0}' wurde nicht gefunden.", sProperty), MsgBoxStyle.Exclamation, sScriptName)
      GoTo Abbruch
    End If
    oCustomCommandHelper = oProperty.GetValue(ACTApp.Explorer, Nothing)
    If oCustomCommandHelper Is Nothing Then
      MsgBox(String.Format("Das Objekt '{0}' konnte nicht erstellt werden.", sProperty), MsgBoxStyle.Exclamation, sScriptName)
      GoTo Abbruch
    End If
    oMethod = oCustomCommandHelper.GetType.GetMethod(sMethod, Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Static)
    If oMethod Is Nothing Then
      MsgBox(String.Format("Die Methode '{0}' wurde nicht gefunden.", sMethod), MsgBoxStyle.Exclamation, sScriptName)
      GoTo Abbruch
    End If
    aParameter(0) = sPath
    Try
      oMethod.Invoke(oCustomCommandHelper, aParameter)
    Catch ex As Exception
      MsgBox(String.Format("Es ist ein Fehler beim Ausführen der Methode '{0}' aufgetreten.", sMethod) &amp; vbCrLf &amp; _
        ex.Message, MsgBoxStyle.Exclamation, sScriptName)
    End Try
    Abbruch:
    Return String.Empty</Source>
        <SourceComment>Begriff: {0}</SourceComment>
        <TargetFields></TargetFields>
        <MsgText>{0}</MsgText>
        <Picklist></Picklist>
        <Multiple>False</Multiple>
        <Expandable>True</Expandable>
        <OverwriteAlways>True</OverwriteAlways>
        <CopyToClipboard>False</CopyToClipboard>
        <ShowMsgBox>False</ShowMsgBox>
        <PositionMode>1</PositionMode>
        <FlatStyle>Standard</FlatStyle>
        <AutoDataText>Brief erstellen aus spezieller Vorlage</AutoDataText>
        <TextAlign>MiddleCenter</TextAlign>
        <AutoDataFormSize>160; 270</AutoDataFormSize>
        <TooltipText>Erstellt einen Brief aus einer Vorlage</TooltipText>
        <RefreshLoadedViews>False</RefreshLoadedViews>
    </AutoDataControl>
</AutoDataItems>