Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 1d6c34c138f887ce…

MALICIOUS

Office (OOXML)

182.9 KB Created: 2021-05-12 07:24:00 UTC Authoring application: Microsoft Office Word 15.0000 First seen: 2021-05-29
MD5: db95788fc62f8310400e0a25b943b37d SHA-1: 6e5c509763b5067ca1c90b81bf0480205d15125c SHA-256: 1d6c34c138f887ced64aae8e6c729b85e61013149c1a2d16dc228c3c8ba50e51
238 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment T1140 Deobfuscate or Obfuscate Malicious Code T1204.002 Malicious File

The sample is an Office document containing an obfuscated VBA macro that executes upon opening. The macro utilizes WScript.Shell and CreateObject, indicating an attempt to download and execute a second-stage payload. The document body discusses environmental inspections, likely serving as a lure to encourage users to enable macros.

Heuristics 8

  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Dim intText As Integer
        Set WsShell = CreateObject("WScript.Shell")
        intText = WsShell.Popup(strMessage, 1, "Übernahme Daten")
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
    Matched line in script
        Dim intText As Integer
        Set WsShell = CreateObject("WScript.Shell")
        intText = WsShell.Popup(strMessage, 1, "Übernahme Daten")
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Dim intText As Integer
        Set WsShell = CreateObject("WScript.Shell")
        intText = WsShell.Popup(strMessage, 1, "Übernahme Daten")
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled VBA/cache stream contains an auto-execution token together with shell/download/object-execution tokens. This catches p-code-only or source-extraction-failure macro documents where visible source is unavailable.
  • Document_Open macro low OLE_VBA_DOCOPEN
    Document_Open macro
    Matched line in script
    Private Sub Document_Open()
  • External hyperlinks (1) low OOXML_EXTERNAL_HYPERLINKS
    Document contains 1 external hyperlink — clickable URLs are stored as external relationships. First target: https://secure.umweltbundesamt.at/edm_portal/cms.do?get=/portal/informationen/ie-richtlinie-und-ippc-anlagen/genehmigungsinhalte.main
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL https://secure.umweltbundesamt.at/edm_portal/cms.do?get=/portal/informationen/ie-richtlinie-und-ippc-anlagen/genehmigungsinhalte.main#index_4 In document text (OOXML body / shared strings)
    • https://secure.umweltbundesamt.at/edm_portal/cms.do?get=/portal/informationen/ie-richtlinie-und-ippc-anlagen/genehmigungsinhalte.mainDocument hyperlink
    • http://schemas.microsoft.com/office/word/2010/wordprocessingCanvasIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)
    • http://www.apache.org/licenses/LICENSE-2.0In document text (OOXML body / shared strings)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 66720 bytes
SHA-256: 08be917ac3100ecdaef68687c92105bd43c205d1e14b76f4655a1dd9af5ef98e
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Dim RegistryEventHandler As New EventClassModule


Private Sub Document_Open()


    Set RegistryEventHandler.AppWord = Word.Application


End Sub

Public Sub Modus_Langfassung_Click()
'**********************************************
'Alle Blöcke für die Langfassung werden eingeblendet
'**********************************************

Const Passwort = ""
Dim bState As Boolean
'Dokumentschutz aufheben
bState = False
If ActiveDocument.ProtectionType <> wdNoProtection Then
    ActiveDocument.Unprotect Password:=Passwort
    bState = True
End If


'Hinweise auf Zusammenfassungs, Veröffentlichung  ausblenden
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG", True, True)
Call ToogleBookmark("MODUS_ZUSAMMENFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG", True, True)
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG2", True, True)
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG2", True, True)
Call ToogleBookmark("MODUS_VEROEFFENTLICHUNG", True, True)


'alles andere einblenden
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_ERG_BESCHREIBUNG", False, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSVORSCHRIFT", False, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BESCHEIDE", False, True)

Call ToogleBookmark("BLOCK_EDM_STAMMDATEN", False, True)
Call ToogleBookmark("BLOCK_FACHBEREICHE", False, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG", False, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG2", False, True)
Call ToogleBookmark("MODUS_LANGFASSUNG", False, True)

Call ToogleBookmark("GESAMT_ZUSAMMENFASSUNG", False, True)
Call ToogleBookmark("VORB_WEITERGABE", False, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BVT", False, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSGRUNDLAGE", False, True)
Call ToogleBookmark("GESAMT_UMWELTRISIKO", False, True)

Call ToogleBookmark("STAMMDATEN_BLATT_BERICHTSEINHEIT", False, True)
Call ToogleBookmark("STAMMDATEN_BLATT_TECHN_DATEN", False, True)

'Luftblöcke ein-/ausblenden
Call enableLuftBlock
Call enableWasserBlock
Call enableAbfallBlock
Call enableLAermBlock

' maximal 50 Subanlagen vorgesehen; kann man hier aber ändern, müssen aber gar nicht vorhanden sein
For i = 1 To 50
    Dim str As String
    If i < 10 Then
        str = "STAMMDATEN_BLATT_TECHN_DATEN_0" + CStr(i)
    Else
        str = "STAMMDATEN_BLATT_TECHN_DATEN_" + CStr(i)
    End If
 Call ToogleBookmark(str, False, False)
Next



'Dokumentschutz setzen
If bState Then
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
    NoReset:=True, Password:=Passwort
End If

End Sub

Sub AbschnitteSchuetzen()
    Dim mySec As Word.Section
    Dim i As Integer
           
    If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
        ActiveDocument.Unprotect Password:=""
    End If
    ' Zunächst wird der Schutz mit Passwort für das ganze Dokument aufgehoben.
       
    For Each mySec In ActiveDocument.Sections
        mySec.ProtectedForForms = False
    Next mySec
    ' In der ersten Schleife werden alle Abschnitte ungeschützt.
       
    For i = 1 To ActiveDocument.Sections.Count Step 2
        ActiveDocument.Sections(i).ProtectedForForms = True
    Next i
    ' In der zweiten Schleife wird jeder 2. Abschnitt geschützt,
    ' beginnend mit Abschnitt 1
       
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
        NoReset:=True, Password:=""
    ' Der Formularschutz mit Passwort wird wieder eingeschaltet,
    ' und zwar für die "markierten" Abschnitte
End Sub




Public Sub Modus_Veröffentlichung_Click()
'**********************************************
'Alle Blöcke für die Veröffentlichung werden eingeblendet, der Rest wird ausgeblendet!
'**********************************************

Const Passwort = ""
Dim bState As Boolean
'Dokumentschutz aufheben
bState = False
If ActiveDocument.ProtectionType <> wdNoProtection Then
    ActiveDocument.Unprotect Password:=Passwort
    bState = True
End If


'Verborgene Texte immer ausschalten
ActiveWindow.View.ShowAll = False
ActiveWindow.View.ShowHiddenText = False


'Hinweise auf Veröffentlichung einblenden
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG", False, True)
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG2", False, True)
Call ToogleBookmark("MODUS_VEROEFFENTLICHUNG", False, True)


'alles andere ausblenden
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_ERG_BESCHREIBUNG", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSVORSCHRIFT", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BESCHEIDE", True, True)

Call ToogleBookmark("BLOCK_EDM_STAMMDATEN", True, True)
Call ToogleBookmark("BLOCK_EDM_STAMMDATEN_DETAIL", True, True)

Call ToogleBookmark("BLOCK_FACHBEREICHE", True, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG2", True, True)
Call ToogleBookmark("MODUS_LANGFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG2", True, True)
Call ToogleBookmark("MODUS_ZUSAMMENFASSUNG", True, True)

Call ToogleBookmark("GESAMT_ZUSAMMENFASSUNG", True, True)
Call ToogleBookmark("VORB_WEITERGABE", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BVT", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSGRUNDLAGE", True, True)
Call ToogleBookmark("GESAMT_UMWELTRISIKO", True, True)

Call ToogleBookmark("STAMMDATEN_BLATT_BERICHTSEINHEIT", True, True)
Call ToogleBookmark("STAMMDATEN_BLATT_TECHN_DATEN", True, True)

' maximal 50 Subanlagen vorgesehen; kann man hier aber ändern, müssen aber gar nicht vorhanden sein
For i = 1 To 50
    Dim str As String
    If i < 10 Then
        str = "STAMMDATEN_BLATT_TECHN_DATEN_0" + CStr(i)
    Else
        str = "STAMMDATEN_BLATT_TECHN_DATEN_" + CStr(i)
    End If
 Call ToogleBookmark(str, True, False)
Next


'Dokumentschutz setzen
If bState Then
    'wdAllowOnlyReading
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
    NoReset:=True, Password:=Passwort
End If
End Sub

Public Sub Modus_Zusammenfassung_Click()
'**********************************************
'Alle Blöcke für die Zusammenfassung werden eingeblendet, der Rest wird ausgeblendet!
'**********************************************

Const Passwort = ""
Dim bState As Boolean
'Dokumentschutz aufheben
bState = False
If ActiveDocument.ProtectionType <> wdNoProtection Then
    ActiveDocument.Unprotect Password:=Passwort
    bState = True
End If

'Verborgene Texte immer ausschalten
ActiveWindow.View.ShowAll = False
ActiveWindow.View.ShowHiddenText = False


'Hinweise auf Zusammenfassung einblenden
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG", False, True)
Call ToogleBookmark("FUSSZEILE_ZUSAMMENFASSUNG2", False, True)
Call ToogleBookmark("MODUS_ZUSAMMENFASSUNG", False, True)


'alles andere einblenden
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_ERG_BESCHREIBUNG", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSVORSCHRIFT", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BESCHEIDE", True, True)

Call ToogleBookmark("BLOCK_EDM_STAMMDATEN", False, True)
Call ToogleBookmark("BLOCK_EDM_STAMMDATEN_DETAIL", True, True)

Call ToogleBookmark("BLOCK_FACHBEREICHE", True, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_LANGFASSUNG2", True, True)
Call ToogleBookmark("MODUS_LANGFASSUNG", True, True)
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG", True, True)
Call ToogleBookmark("FUSSZEILE_VEROEFFENTLICHUNG2", True, True)
Call ToogleBookmark("MODUS_VEROEFFENTLICHUNG", True, True)

Call ToogleBookmark("GESAMT_ZUSAMMENFASSUNG", True, True)
Call ToogleBookmark("VORB_WEITERGABE", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_BVT", True, True)
Call ToogleBookmark("BLOCK_IPPC_ANLAGE_RECHTSGRUNDLAGE", True, True)
Call ToogleBookmark("GESAMT_UMWELTRISIKO", True, True)

Call ToogleBookmark("STAMMDATEN_BLATT_BERICHTSEINHEIT", True, True)
Call ToogleBookmark("STAMMDATEN_BLATT_TECHN_DATEN", False, True)


' maximal 50 Subanlagen vorgesehen; kann man hier aber ändern, müssen aber gar nicht vorhanden sein
For i = 1 To 50
    Dim str As String
    If i < 10 Then
        str = "STAMMDATEN_BLATT_TECHN_DATEN_0" + CStr(i)
    Else
        str = "STAMMDATEN_BLATT_TECHN_DATEN_" + CStr(i)
    End If
 Call ToogleBookmark(str, False, False)
Next

' In der Zusamenfassung auf das erste Feld springen für die technsche Angaben zur Eingabe
If ActiveDocument.Bookmarks.Exists("Text1") Then
    With Selection
     .GoTo What:=wdGoToBookmark, Name:="Text1"
    End With
End If

'Dokumentschutz setzen
If bState Then
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
    NoReset:=True, Password:=Passwort
End If


End Sub

Private Sub PDF_Druck_Langfassung()
'**********************************************
'PDF Druck für die Langfassung
'**********************************************

Dim strDateiname As String
Dim Pfad As String
Dim strPDF As String

Call Modus_Langfassung_Click:


Pfad = ActiveDocument.Path
strDateiname = "\Lang_" & Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4)
strPDF = Pfad & strDateiname & "pdf"

ActiveDocument.ExportAsFixedFormat OutputFileName:=strPDF, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:= _
  wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=2, To:=2147483647, _
  Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
  CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
  BitmapMissingFonts:=True, UseISO19005_1:=False


End Sub
Private Sub PDF_Druck_Veröffentlichung()

Dim strDateiname As String
Dim Pfad As String
Dim strPDF As String

Call Modus_Zusammenfassung_Click

Pfad = ActiveDocument.Path
strDateiname = "\Kurz_" & Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4)
strPDF = Pfad & strDateiname & "pdf"

ActiveDocument.ExportAsFixedFormat OutputFileName:=strPDF, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:= _
  wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=2, To:=2147483647, _
  Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
  CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
  BitmapMissingFonts:=True, UseISO19005_1:=False


End Sub

Sub ToogleBookmark(strBMName, bValue, bError)
Dim response
If ActiveDocument.Bookmarks.Exists(strBMName) Then
    ActiveDocument.Bookmarks(strBMName).Range.Font.Hidden = bValue
Else
   If bError Then
        response = MsgBox("Eingabefeld:'" + strBMName + "' fehlt. Möglicherweise funktioniert das Formular nicht korrekt!", 64)
   End If
End If

End Sub

Sub enableLuftBlock()
    Select Case ActiveDocument.FormFields("ABSCHNITT_LUFT").Result
    Case "-0-"
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_1", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_3", True, True)
    Case "-1-"
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_3", True, True)
       
    Case "-2-"
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_3", True, True)
    Case "-3-"
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_3", False, True)
    Case Else
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LUFT_3", True, True)
    End Select
    
    ActiveDocument.GoTo What:=wdGoToBookmark, Name:="DUMMY_LUFT"
    ActiveDocument.Bookmarks("DUMMY_LUFT").Select

    
End Sub
Sub enableWasserBlock()
    Select Case ActiveDocument.FormFields("ABSCHNITT_WASSER").Result
    Case "-0-"
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_1", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_3", True, True)
    Case "-1-"
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_3", True, True)
    
    Case "-2-"
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_3", True, True)
    Case "-3-"
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_3", False, True)
    Case Else
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_WASSER_3", True, True)
    End Select
    ActiveDocument.GoTo What:=wdGoToBookmark, Name:="DUMMY_WASSER"
    ActiveDocument.Bookmarks("DUMMY_WASSER").Select
End Sub
Sub enableAbfallBlock()
    Select Case ActiveDocument.FormFields("ABSCHNITT_ABFALL").Result
    Case "-0-"
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_1", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_3", True, True)
    Case "-1-"
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_3", True, True)
    Case "-2-"
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_3", True, True)
    Case "-3-"
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_3", False, True)
    Case Else
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_ABFALL_3", True, True)
    End Select
    ActiveDocument.GoTo What:=wdGoToBookmark, Name:="DUMMY_ABFALL"
    ActiveDocument.Bookmarks("DUMMY_ABFALL").Select
End Sub
Sub enableLAermBlock()
    Select Case ActiveDocument.FormFields("ABSCHNITT_LAERM").Result
    Case "-0-"
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_1", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_3", True, True)
    Case "-1-"
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_3", True, True)

    Case "-2-"
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_3", True, True)
    Case "-3-"
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_2", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_3", False, True)
    Case Else
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_1", False, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_2", True, True)
        Call ThisDocument.ToogleBookmark("BLOCK_LAERM_3", True, True)
    End Select
    ActiveDocument.GoTo What:=wdGoToBookmark, Name:="DUMMY_LAERM"
    ActiveDocument.Bookmarks("DUMMY_LAERM").Select
End Sub
Public Sub FELD_VEROEF_EDM_Click()
    If (ActiveDocument.FormFields("FELD_VEROEF_EDM").CheckBox.Value = True) Then
        ActiveDocument.FormFields("FELD_VEROEF_NON_EDM").CheckBox.Value = False
    End If
    If (ActiveDocument.FormFields("FELD_VEROEF_EDM").CheckBox.Value = False) Then
        ActiveDocument.FormFields("FELD_VEROEF_NON_EDM").CheckBox.Value = True
    End If
End Sub

Public Sub FELD_VEROEF_NON_EDM_Click()
    If (ActiveDocument.FormFields("FELD_VEROEF_NON_EDM").CheckBox.Value = True) Then
        ActiveDocument.FormFields("FELD_VEROEF_EDM").CheckBox.Value = False
    End If
    If (ActiveDocument.FormFields("FELD_VEROEF_NON_EDM").CheckBox.Value = False) Then
        ActiveDocument.FormFields("FELD_VEROEF_EDM").CheckBox.Value = True
    End If
End Sub



Attribute VB_Name = "NewMacros"
Dim RegistryEventHandler As New EventClassModule

Private Sub Document_Open()

    Set RegistryEventHandler.AppWord = Word.Application

End Sub

Sub exitLuft()
Attribute exitLuft.VB_ProcData.VB_Invoke_Func = "Project.NewMacros.Makro6"
'
'Übernahme der Luftergebnisse in das Gesamtergebnis
 Application.ScreenUpdating = False
 Dim textMangel As String
 Dim textText As String
 Dim textFrist As String

 Dim ctlCurrentControl As Control
 Dim strControlName As String

 textMangel = ""
 textText = ""
 textFrist = ""
    
 'abhängig von den eingestellten Blöcken, die anderen Ergebnisse dazugeben
 Select Case ActiveDocument.FormFields("ABSCHNITT_LUFT").DropDown.Value
    Case 2
        textMangel = getMangel(ActiveDocument.FormFields("LUFT_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LUFT_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LUFT_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST_B").Range.Fields(1).Result.Text
 
    Case 3
        textMangel = getMangel(ActiveDocument.FormFields("LUFT_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LUFT_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LUFT_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LUFT_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LUFT_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST2_B").Range.Fields(1).Result.Text
        
    Case 4
        textMangel = getMangel(ActiveDocument.FormFields("LUFT_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LUFT_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LUFT_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LUFT_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LUFT_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST2_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LUFT_MANGEL3").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LUFT_TEXT3").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LUFT_MASSN3_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LUFT_FRIST3_B").Range.Fields(1).Result.Text

    End Select
    
     
 'Ergebnisfelder für Eingabe ermöglichen
 ActiveDocument.FormFields("ERGEB_LUFT").Enabled = True
 ActiveDocument.FormFields("ERGEB_LUFT_TXT").Enabled = True
 ActiveDocument.FormFields("ERGEB_LUFT_FRIST").Enabled = True
  
 
 ActiveDocument.FormFields("ERGEB_LUFT").Result = textMangel
 ActiveDocument.FormFields("ERGEB_LUFT_FRIST").Range.Fields(1).Result.Text = textFrist
 ActiveDocument.FormFields("ERGEB_LUFT_TXT").Range.Fields(1).Result.Text = textText
 
 
 'Ergebnisfelder für Eingabe disablen . read only
 ActiveDocument.FormFields("ERGEB_LUFT").Enabled = False
 ActiveDocument.FormFields("ERGEB_LUFT_TXT").Enabled = False
 ActiveDocument.FormFields("ERGEB_LUFT_FRIST").Enabled = False
 
Application.ScreenUpdating = True
 
End Sub
Sub enterField()
    'MsgBox SelectedContentControl
End Sub


Sub Test2()
MsgBox SelectedContentControl
End Sub


Private Function SelectedContentControl() As String 'ContentControl

For Each bm In ActiveDocument.Bookmarks
 If Selection.InRange(bm.Range) Then
  SelectedContentControl = bm.Name
  BMText = bm.Range.Text
 End If
Next

End Function
Private Function getMangel(postion As Integer) As String
Select Case postion
    Case 1
        getMangel = "keine Mängel"
    Case 2
        getMangel = "geringfügige Mängel"
    Case 3
        getMangel = "erhebliche Mängel"
    Case 4
        getMangel = "schwerwiegende Mängel"
    Case 5
        getMangel = "---"
 End Select
End Function
 
Sub exitWasser()
'
' Übernahme der Wasserergebnisse in das Gesamtergebnis
'
Application.ScreenUpdating = False
Dim textMangel As String
Dim textText As String
Dim textFrist As String

 textMangel = ""
 textText = ""
 textFrist = ""
    
    
 'abhängig von den eingestellten Blöcken, die anderen Ergebnisse dazugeben
 Select Case ActiveDocument.FormFields("ABSCHNITT_WASSER").DropDown.Value
    Case 2
        textMangel = getMangel(ActiveDocument.FormFields("WASSER_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("WASSER_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("WASSER_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST_B").Range.Fields(1).Result.Text

    Case 3
        textMangel = getMangel(ActiveDocument.FormFields("WASSER_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("WASSER_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("WASSER_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("WASSER_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("WASSER_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST2_B").Range.Fields(1).Result.Text

        
    Case 4
        textMangel = getMangel(ActiveDocument.FormFields("WASSER_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("WASSER_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("WASSER_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("WASSER_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("WASSER_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST2_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("WASSER_MANGEL3").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("WASSER_TEXT3").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("WASSER_MASSN3_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("WASSER_FRIST3_B").Range.Fields(1).Result.Text

    End Select
    
     
 'Ergebnisfelder für Eingabe ermöglichen
 ActiveDocument.FormFields("ERGEB_WASSER").Enabled = True
 ActiveDocument.FormFields("ERGEB_WASSER_TXT").Enabled = True
 ActiveDocument.FormFields("ERGEB_WASSER_FRIST").Enabled = True
  
 
 ActiveDocument.FormFields("ERGEB_WASSER").Result = textMangel
 ActiveDocument.FormFields("ERGEB_WASSER_FRIST").Range.Fields(1).Result.Text = textFrist
 ActiveDocument.FormFields("ERGEB_WASSER_TXT").Range.Fields(1).Result.Text = textText
 
 
 'Ergebnisfelder für Eingabe disablen . read only
 ActiveDocument.FormFields("ERGEB_WASSER").Enabled = False
 ActiveDocument.FormFields("ERGEB_WASSER_TXT").Enabled = False
 ActiveDocument.FormFields("ERGEB_WASSER_FRIST").Enabled = False
 Application.ScreenUpdating = True
End Sub

Sub exitAbfall()
'
' Übernahme der Abfallergebnisse in das Gesamtergebnis
'

Application.ScreenUpdating = False
Dim textMangel As String
Dim textText As String
Dim textFrist As String

 textMangel = ""
 textText = ""
 textFrist = ""
    
 'abhängig von den eingestellten Blöcken, die anderen Ergebnisse dazugeben
 Select Case ActiveDocument.FormFields("ABSCHNITT_ABFALL").DropDown.Value
    Case 2
        textMangel = getMangel(ActiveDocument.FormFields("ABFALL_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("ABFALL_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("ABFALL_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST_B").Range.Fields(1).Result.Text
    Case 3
        textMangel = getMangel(ActiveDocument.FormFields("ABFALL_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("ABFALL_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("ABFALL_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("ABFALL_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("ABFALL_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST2_B").Range.Fields(1).Result.Text

        
    Case 4
        textMangel = getMangel(ActiveDocument.FormFields("ABFALL_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("ABFALL_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("ABFALL_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("ABFALL_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("ABFALL_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST2_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("ABFALL_MANGEL3").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("ABFALL_TEXT3").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("ABFALL_MASSN3_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("ABFALL_FRIST3_B").Range.Fields(1).Result.Text

    End Select
    
     
 'Ergebnisfelder für Eingabe ermöglichen
 ActiveDocument.FormFields("ERGEB_ABFALL").Enabled = True
 ActiveDocument.FormFields("ERGEB_ABFALL_TXT").Enabled = True
 ActiveDocument.FormFields("ERGEB_ABFALL_FRIST").Enabled = True
  
 
 ActiveDocument.FormFields("ERGEB_ABFALL").Result = textMangel
 ActiveDocument.FormFields("ERGEB_ABFALL_FRIST").Range.Fields(1).Result.Text = textFrist
 ActiveDocument.FormFields("ERGEB_ABFALL_TXT").Range.Fields(1).Result.Text = textText
 
 
 'Ergebnisfelder für Eingabe disablen . read only
 ActiveDocument.FormFields("ERGEB_ABFALL").Enabled = False
 ActiveDocument.FormFields("ERGEB_ABFALL_TXT").Enabled = False
 ActiveDocument.FormFields("ERGEB_ABFALL_FRIST").Enabled = False
 Application.ScreenUpdating = True
 
End Sub

Sub exitLaerm()
'
' Übernahme der Lärmergebnisse in das Gesamtergebnis
'

Application.ScreenUpdating = False
Dim textMangel As String
Dim textText As String
Dim textFrist As String


 textMangel = ""
 textText = ""
 textFrist = ""
    
    
 'abhängig von den eingestellten Blöcken, die anderen Ergebnisse dazugeben
 Select Case ActiveDocument.FormFields("ABSCHNITT_LAERM").DropDown.Value
    Case 2
        textMangel = getMangel(ActiveDocument.FormFields("LAERM_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LAERM_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LAERM_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST_B").Range.Fields(1).Result.Text
   
    Case 3
        textMangel = getMangel(ActiveDocument.FormFields("LAERM_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LAERM_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LAERM_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LAERM_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LAERM_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST2_B").Range.Fields(1).Result.Text

        
    Case 4
        textMangel = getMangel(ActiveDocument.FormFields("LAERM_MANGEL").DropDown.Value)
        textText = ActiveDocument.FormFields("LAERM_TEXT").Range.Fields(1).Result.Text
        textFrist = ActiveDocument.FormFields("LAERM_MASSN_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LAERM_MANGEL2").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LAERM_TEXT2").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST2_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN2_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST2_B").Range.Fields(1).Result.Text
        
        textMangel = textMangel + Chr(13) + getMangel(ActiveDocument.FormFields("LAERM_MANGEL3").DropDown.Value)
        textText = textText + Chr(13) + ActiveDocument.FormFields("LAERM_TEXT3").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST3_A").Range.Fields(1).Result.Text
        textFrist = textFrist + Chr(13) + ActiveDocument.FormFields("LAERM_MASSN3_B").Range.Fields(1).Result.Text
        textFrist = textFrist + " " + ActiveDocument.FormFields("LAERM_FRIST3_B").Range.Fields(1).Result.Text

    End Select
    
     
 'Ergebnisfelder für Eingabe ermöglichen
 ActiveDocument.FormFields("ERGEB_LAERM").Enabled = True
 ActiveDocument.FormFields("ERGEB_LAERM_TXT").Enabled = True
 ActiveDocument.FormFields("ERGEB_LAERM_FRIST").Enabled = True
  
 
 ActiveDocument.FormFields("ERGEB_LAERM").Result = textMangel
 ActiveDocument.FormFields("ERGEB_LAERM_FRIST").Range.Fields(1).Result.Text = textFrist
 ActiveDocument.FormFields("ERGEB_LAERM_TXT").Range.Fields(1).Result.Text = textText
 
 
 'Ergebnisfelder für Eingabe disablen . read only
 ActiveDocument.FormFields("ERGEB_LAERM").Enabled = False
 ActiveDocument.FormFields("ERGEB_LAERM_TXT").Enabled = False
 ActiveDocument.FormFields("ERGEB_LAERM_FRIST").Enabled = False
 Application.ScreenUpdating = True

 
End Sub

Sub exitSonstiges()
'
' Übernahme der sonstigen Eingaben in das Gesamtergebnis
'
Application.ScreenUpdating = False
Dim textMangel As String
Dim textText As String
Dim textFrist As String
Dim textLabel As String

 textMangel = getMangel(ActiveDocument.FormFields("SONSTIGES_MANGEL").DropDown.Value)
 textText = ActiveDocument.FormFields("SONSTIGES_TXT").Range.Fields(1).Result.Text
 textFrist = ActiveDocument.FormFields("SONSTIGES_MASSN_A").Range.Fields(1).Result.Text
 textFrist = textFrist + " " + ActiveDocument.FormFields("SONSTIGES_FRIST").Range.Fields(1).Result.Text

 textLabel = ActiveDocument.FormFields("FELD_SNST_INH").Range.Fields(1).Result.Text
    
        
 'Ergebnisfelder für Eingabe ermöglichen
 ActiveDocument.FormFields("ERGEB_SONSTIGES").Enabled = True
 ActiveDocument.FormFields("ERGEB_SONSTIGES_TXT").Enabled = True
 ActiveDocument.FormFields("ERGEB_SONSTIGES_FRIS").Enabled = True
 ActiveDocument.FormFields("ERGEB_SONST_LABEL").Enabled = True
   
 ActiveDocument.FormFields("ERGEB_SONSTIGES").Result = textMangel
 ActiveDocument.FormFields("ERGEB_SONSTIGES_TXT").Range.Fields(1).Result.Text = textText
 ActiveDocument.FormFields("ERGEB_SONSTIGES_FRIS").Range.Fields(1).Result.Text = textFrist
 ActiveDocument.FormFields("ERGEB_SONST_LABEL").Range.Fields(1).Result.Text = textLabel
 
 'Ergebnisfelder für Eingabe disablen . read only
 ActiveDocument.FormFields("ERGEB_SONSTIGES").Enabled = False
 ActiveDocument.FormFields("ERGEB_SONSTIGES_TXT").Enabled = False
 ActiveDocument.FormFields("ERGEB_SONSTIGES_FRIS").Enabled = False
 ActiveDocument.FormFields("ERGEB_SONST_LABEL").Enabled = False
 
 
 Application.ScreenUpdating = True
End Sub

Sub startErgebMangel()
'
' Gesamtergebnis - Mängel können nur angegeben werden, wenn 'Mängel, die noch nicht behoben wurden,' gewehlt wurde
'

Dim textMangel As String
Dim textConst As String
Dim response
Dim bMin, bMedium, bMax As Boolean

 textConst = "Mängel, die noch nicht behoben wurden,"
 
 textMangel = ActiveDocument.FormFields("GESAMT_MANGEL").Result
    
 If textMangel <> textConst Then
    bMin = ActiveDocument.FormFields("GESAMT_MANGEL_MIN").CheckBox.Value
    bMedium = ActiveDocument.FormFields("GESAMT_MANGEL_MED").CheckBox.Value
    bMax = ActiveDocument.FormFields("GESAMT_MANGEL_MAX").CheckBox.Value
    
    If (bMin Or bMedium Or bMax) Then
        response = MsgBox("Mängel können nur angegeben werden, wenn" + Chr(13) + Chr(13) + Chr(10) + "'Mängel, die noch nicht behoben wurden,'" + Chr(13) + Chr(13) + Chr(10) + "gewählt wurde!", 64)
    End If
    ActiveDocument.FormFields("GESAMT_MANGEL_MIN").CheckBox.Value = False
    ActiveDocument.FormFields("GESAMT_MANGEL_MED").CheckBox.Value = False
    ActiveDocument.FormFields("GESAMT_MANGEL_MAX").CheckBox.Value = False

 End If
End Sub
Sub PDF_Druck_Veröffentlichung()

Dim strDateiname As String
Dim Pfad As String
Dim strPDF As String

Call Modus_Zusammenfassung_Click

Pfad = ActiveDocument.Path
strDateiname = "\Kurz_" & Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4)
strPDF = Pfad & strDateiname & "pdf"

ActiveDocument.ExportAsFixedFormat OutputFileName:=strPDF, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:= _
  wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=2, To:=2147483647, _
  Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
  CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
  BitmapMissingFonts:=True, UseISO19005_1:=False


End Sub
Sub PDFSpeichern()
Attribute PDFSpeichern.VB_ProcData.VB_Invoke_Func = "Project.NewMacros.PDFSpeichern"
'
' PDFSpeichern Makro
'
'

Dim strDateiname As String
Dim Pfad As String
Dim strPDF As String

Pfad = ActiveDocument.Path
strDateiname = "Zusammenfassung" & Left(ActiveDocument.Name, Len(ActiveDocument.Name) - 4)
strPDF = Pfad & strDateiname & "pdf"


'entsprechende Blöcke ein/ausblenden
ActiveDocument.Bookmarks("BLOCK_IPPC_ANLAGE_ERG_BESCHREIBUNG").Range.Font.Hidden = True
ActiveDocument.Bookmarks("BLOCK_EDM_STAMMDATEN").Range.Font.Hidden = True
ActiveDocument.Bookmarks("BLOCK_FACHBEREICHE").Range.Font.Hidden = True
ActiveDocument.Bookmarks("FUSSZEILE_LANGFASSUNG").Range.Font.Hidden = True
ActiveDocument.Bookmarks("MODUS_LANGFASSUNG").Range.Font.Hidden = True
ActiveDocument.Bookmarks("BLOCK_WEITERFUEHRENDE_INFO").Range.Font.Hidden = False
ActiveDocument.Bookmarks("FUSSZEILE_ZUSAMMENFASSUNG").Range.Font.Hidden = False
ActiveDocument.Bookmarks("MODUS_ZUSAMMENFASSUNG").Range.Font.Hidden = False


ActiveDocument.ExportAsFixedFormat OutputFileName:=strPDF, ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:= _
  wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=2, To:=2147483647, _
  Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
  CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
  BitmapMissingFonts:=True, UseISO19005_1:=False


'entsprechende Blöcke ein/ausblenden
ActiveDocument.Bookmarks("BLOCK_IPPC_ANLAGE_ERG_BESCHREIBUNG").Range.Font.Hidden = False
ActiveDocument.Bookmarks("BLOCK_EDM_STAMMDATEN").Range.Font.Hidden = False
ActiveDocument.Bookmarks("BLOCK_FACHBEREICHE").Range.Font.Hidden = False
ActiveDocument.Bookmarks("FUSSZEILE_LANGFASSUNG").Range.Font.Hidden = False
ActiveDocument.Bookmarks("MODUS_LANGFASSUNG").Range.Font.Hidden = False
ActiveDocument.Bookmarks("BLOCK_WEITERFUEHRENDE_INFO").Range.Font.Hidden = False
ActiveDocument.Bookmarks("FUSSZEILE_ZUSAMMENFASSUNG").Range.Font.Hidden = True
ActiveDocument.Bookmarks("MODUS_ZUSAMMENFASSUNG").Range.Font.Hidden = True


End Sub


Sub textFett(strFeld As String)
'
'Dokumentschutz aufheben
Const Passwort = ""
bState = False
If ActiveDocument.ProtectionType <> wdNoProtection Then
    ActiveDocument.Unprotect Password:=Passwort
    bState = True
End If

Dim bValue As Boolean

    bValue = ActiveDocument.FormFields(strFeld).CheckBox.Value
    Selection.Extend
    Selection.Extend
    Selection.Extend
    
    If bValue Then
        Selection.Font.Bold = True
    Else
        Selection.Font.Bold = False
    End If
    
    'Dokumentschutz setzen
…
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 167936 bytes
SHA-256: 68e16d080db029b15237fa9406982e1c1a0aa1dcda988649c9b55d17fc13ceb6