title image


Smiley Re: Alle Elemente einer Dropdown-Liste exportieren/kopieren
Hallo,



in Word XP gehte es so.

'Attribute VB_Name = "modLiesDropDownEntries"

Sub LiesDropDownEntries()

Dim i

Dim sArray() As String

'

i = ActiveDocument.FormFields("Dropdown1").DropDown.ListEntries.Count

'

If ActiveDocument.ProtectionType wdNoProtection Then ActiveDocument.Unprotect

'

For z = 1 To i

ReDim Preserve sArray(z)

sArray(z) = ActiveDocument.FormFields("DropDown1").DropDown.ListEntries(z).Name

'MsgBox ActiveDocument.FormFields("DropDown1").DropDown.ListEntries(z).Name

'MsgBox sArray(z)

Next z

'

For i = 1 To UBound(sArray)

'am Ende des Dokuments einfügen

ActiveDocument.Paragraphs.Last.Range.Select

Selection.TypeText Text:=sArray(i) & vbNewLine

Next i

'

'oder in Textdatei schreiben

Close

Open "D:\Drop1.txt" For Output As #1

'

For i = 1 To UBound(sArray)

Print #1, sArray(i)

Next i

Close

'

If ActiveDocument.ProtectionType = wdNoProtection Then

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

End If

End Sub      Hubert



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: