Thema Datum  Von Nutzer Rating
Antwort
02.11.2019 17:41:11 Markus
NotSolved
02.11.2019 17:49:49 Markus
NotSolved
02.11.2019 18:12:13 Gast68295
Solved
02.11.2019 18:24:58 Markus
NotSolved
02.11.2019 18:38:08 Gast36715
NotSolved
02.11.2019 18:56:26 Markus
NotSolved
02.11.2019 19:44:39 Gast79608
NotSolved
02.11.2019 19:55:25 Markus
NotSolved
02.11.2019 20:46:14 Gast8118
NotSolved
02.11.2019 20:51:33 Gast13261
Solved
02.11.2019 20:56:24 Gast75949
Solved
02.11.2019 21:03:01 Markus
NotSolved
02.11.2019 21:21:51 Gast82059
NotSolved
02.11.2019 21:33:28 Markus
NotSolved
02.11.2019 21:36:02 Gast79453
NotSolved
02.11.2019 21:38:16 Gast73429
NotSolved
02.11.2019 21:49:19 Markus
NotSolved
02.11.2019 22:37:00 Gast497
*****
Solved
02.11.2019 22:47:12 Markus
NotSolved
03.11.2019 06:34:27 Gast80606
NotSolved
03.11.2019 06:44:38 Gast52688
NotSolved
03.11.2019 06:50:23 Gast86661
NotSolved
Rot Rot VBA Benutzerdefiniterte Eigenschaften auslesen
03.11.2019 09:49:36 Gast509
NotSolved

Ansicht des Beitrags:
Von:
Gast509
Datum:
03.11.2019 09:49:36
Views:
587
Rating: Antwort:
  Ja
Thema:
VBA Benutzerdefiniterte Eigenschaften auslesen

So sollte es auch für die Unterordner klappen:

Sub Final()
'alle Pfad + Dateinamen per Powershell und copy/paste in dieses Document bringen

Const Pfad As String = "c:\users\xxx\desktop\" ' <<< anpassen >>>
Dim Doc As Document

With ActiveDocument
    For i = 1 To .Paragraphs.Count
        f = .Paragraphs(i).Range.Text
        f = Left(f, Len(f) - 1)

        Set Doc = Documents.Open(f, , 1)
        If Doc.CustomDocumentProperties.Count > 0 Then

            If Not Doc.CustomDocumentProperties("Punt") Is Nothing Then

                Debug.Print Doc.CustomDocumentProperties("Punt").Value
                If Doc.CustomDocumentProperties("Punt").Value = "Punt" Then

                    Open Pfad & "log.txt" For Append As #1
                        Print #1, f
                    Close #1
                'kill Pfad & f ' löschen, erst nach Prüfung aktivieren
                End If
            End If
            
        End If
        Doc.Close 0
    Next i
End With
End Sub

=============================================================

Sub T_1()
Dim CProps As DocumentProperties
Dim CProp As DocumentProperty

With ActiveDocument
    Set CProps = .CustomDocumentProperties
    Set CProp = CProps.Add("Punt", False, msoPropertyTypeString, "Punt")
    
End With
End Sub

--------------------------------------

Sub T_2()
Dim p As DocumentProperty

For Each p In ActiveDocument.CustomDocumentProperties
    Debug.Print p.Name, p.Value
Next p
End Sub

 

T_1 und T_2 sind nur "Helfer" um CustomProperties anzulegen bzw auszulesen.

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
02.11.2019 17:41:11 Markus
NotSolved
02.11.2019 17:49:49 Markus
NotSolved
02.11.2019 18:12:13 Gast68295
Solved
02.11.2019 18:24:58 Markus
NotSolved
02.11.2019 18:38:08 Gast36715
NotSolved
02.11.2019 18:56:26 Markus
NotSolved
02.11.2019 19:44:39 Gast79608
NotSolved
02.11.2019 19:55:25 Markus
NotSolved
02.11.2019 20:46:14 Gast8118
NotSolved
02.11.2019 20:51:33 Gast13261
Solved
02.11.2019 20:56:24 Gast75949
Solved
02.11.2019 21:03:01 Markus
NotSolved
02.11.2019 21:21:51 Gast82059
NotSolved
02.11.2019 21:33:28 Markus
NotSolved
02.11.2019 21:36:02 Gast79453
NotSolved
02.11.2019 21:38:16 Gast73429
NotSolved
02.11.2019 21:49:19 Markus
NotSolved
02.11.2019 22:37:00 Gast497
*****
Solved
02.11.2019 22:47:12 Markus
NotSolved
03.11.2019 06:34:27 Gast80606
NotSolved
03.11.2019 06:44:38 Gast52688
NotSolved
03.11.2019 06:50:23 Gast86661
NotSolved
Rot Rot VBA Benutzerdefiniterte Eigenschaften auslesen
03.11.2019 09:49:36 Gast509
NotSolved