Supportnet Computer
Planet of Tech

Supportnet / Forum / Textverarbeitung

Zähler zurücksetzen - Makro in Word





Frage

Hallo Leute, ich soll unseren Zähler für Worddokumente zurücksetzen. Der Zähler ist als Symbol in jedem Word und beim anklicken kommt die automatische Nummer und der Dateiname wird auf diese Nummer gesetzt. Ich weiß jetzt nur nicht (kenn mich mit VBA oder was das ist nciht wirklich aus) wie ich das Teil reseten kann. Wäre für jede Hilfe dankbar. Hier der Code: ------------ Sub Zähler() Documents.Open FileName:="\\server01\Daten\Ablage\arbeitsgruppenvorlagen\prozeduren\zaehler.doc", ConfirmConversions:= _ False, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.Copy Selection.MoveLeft Unit:=wdCell Selection.MoveLeft Unit:=wdCell Selection.Paste Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.InsertFormula Formula:="=SUMME(ÜBER)", NumberFormat:="0000" Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Copy ActiveWindow.Close SaveChanges:=wdSaveChanges Selection.GoTo What:=wdGoToBookmark, Name:="Makrosprung" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.Paste Selection.MoveLeft Unit:=wdCell Selection.MoveLeft Unit:=wdCell End Sub Sub Dateiname() Selection.GoTo What:=wdGoToBookmark, Name:="Makrosprung" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.MoveRight Unit:=wdCell Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "BENUTZERINITIALEN ", PreserveFormatting:=True Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "BENUTZERNAME ", PreserveFormatting:=True Selection.MoveLeft Unit:=wdCell Selection.Copy Selection.EndKey Unit:=wdStory Selection.TypeParagraph Selection.TypeText Text:="\\server01\daten\ablage\" Selection.Paste Selection.TypeText Text:="\" Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "BENUTZERNAME ", PreserveFormatting:=True Selection.GoTo What:=wdGoToBookmark, Name:="Makrosprung" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell Selection.Copy Selection.EndKey Unit:=wdStory Selection.Paste Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Cut Selection.Delete Unit:=wdCharacter, Count:=1 Selection.GoTo What:=wdGoToBookmark, Name:="Makrosprung" End Sub --- Danke und Gruß Phil

Antwort 1 von Guenter

Hallo Phil,

ich könnte mir vorstellen, dass Du in der Datei zaehler.doc den Zähler zurückstellen kannst.

Wenn ich das Makro recht verstehe, wird in dieser Datei die Zahl erzeugt und in das neue Dokument übernommen.
Du kannst doch mal testen, was in der zaehler.doc drin steht.

Gegebenenfalls nochmals melden. Ich bin aber erst nächste Woche wieder im Supportnet.

Gruß
Günter

Ich möchte kostenlos eine Frage an die Mitglieder stellen:


Ähnliche Themen:


Suche in allen vorhandenen Beiträgen: