Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBA - Hilfe; Felder aktualisieren

Empfohlene Antworten

Veröffentlicht

Hallo community, :)

ich habe einen VBA-Code im Internet gefunden welcher automatisch meine Worddatei aktualisiert. Um ihn besser verstehen zu können bräuchte ich kurz eure hilfe. Könnt ihr mir den vielleicht in Kommentaren Zeile für Zeile erklären?

Das wäre echt sehr hilfreich.

Hier ist der Code:

Dim oStory As Range

   Application.ScreenUpdating = False

   Application.DisplayAlerts = wdAlertsNone

   For Each oStory In ActiveDocument.StoryRanges

     oStory.Fields.Update

     While Not (oStory.NextStoryRange Is Nothing)

       Set oStory = oStory.NextStoryRange

       oStory.Fields.Update

     Wend

   Next

   Application.DisplayAlerts = wdAlertsAll

   Application.ScreenUpdating = True

Für jede Antwort bin ich dankbar :)

Danke und viele liebe Grüße

Julia

nabend :)


Dim oStory As Range

'setzt die variable "ostory" als range-object

   Application.ScreenUpdating = False

'deaktiviert die automatische aktualisierung der anzeige (am besten mal auskommentieren und anschauen)

   Application.DisplayAlerts = wdAlertsNone

'es sollen keine fehler ausgegeben werden 

   For Each oStory In ActiveDocument.StoryRanges

'normale for-schleife die alle "range"-objekte des Dokumentes durchgeht

     oStory.Fields.Update

'updatet alle vorhandenen felder im dokument

     While Not (oStory.NextStoryRange Is Nothing)

'while-schleife die solange durchgeht bis das dokument zu ende ist (while not)

       Set oStory = oStory.NextStoryRange

'oStory wird auf den nächsten bereich gelegt

       oStory.Fields.Update

'nochmals nen update von feldern

     Wend

'while-schleifen-ende

   Next

'for-schleife geht zum nächsten element

   Application.DisplayAlerts = wdAlertsAll

   Application.ScreenUpdating = True

'wenn die for-schleife durchgelaufen ist, werden die attribute von vorhin wieder gesetzt

ich hoffe mal es war verständlich ^^

wow.. und schon wieder geholfen..

vielen lieben dank :)

ich muss diese vba geschichte für meinen chef machen und kenne m,ich leider überhaupt nicht damit aus.. da kann ich jede hilfe gebrauchen :)

das ist echt toll

nochmals danke und hab eine schöne woche

viele liebe grüße

Julia

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.