Re: Extend the standard commandBar with code

From: Klaus Linke (info_at_fotosatz-kaufmann.de.no.junk)
Date: 03/10/04


Date: Wed, 10 Mar 2004 03:45:07 +0100

Hi Joe,

The macro recorder worked for me (accessing the properties through the
"context dialog" button on the keyboard). Code see below.
I'd delete the line ".Name = "Text1", so that a new bookmark is created
every time you use the macro.
Perhaps some other changes may be needed...

Klaus

  Selection.FormFields.Add Range:=Selection.Range, _
     Type:= wdFieldFormTextInput
  Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
  With Selection.FormFields(1)
    .Name = "Text1"
    .EntryMacro = ""
    .ExitMacro = ""
    .Enabled = True
    .OwnHelp = False
    .HelpText = ""
    .OwnStatus = False
    .StatusText = ""
    With .TextInput
      .EditType Type:=wdRegularText, Default:="This is a test", _
        Format :=""
      .Width = 50
    End With
  End With


Loading