How to create a MS-Word-Form-Region which allows above-insertion? How to create a MS-Word-Form-Region which allows above-insertion? vba vba

How to create a MS-Word-Form-Region which allows above-insertion?


Are you in need to inserting a text in a word document in MS Word, something like this,

https://support.microsoft.com/en-us/kb/212682?wa=wsignin1.0


To insert a new region above an old one, it's as simple as clicking right on an existing region and "Insert element above".

https://msdn.microsoft.com/EN-US/library/office/jj889465.aspx


VBA method using bookmarks:

  1. Define a bookmark where you want to add the new texts, e.g. after a header but before the other regions.

  2. Add a VBA code module and enter the following macro:

    Option ExplicitSub AddNewLine(psText As String)    '***** Go to bookmark    Selection.GoTo What:=wdGoToBookmark, Name:="[NAMEOFBOOKMARK]"    '***** Place cursor at end of bookmark    Selection.Collapse Direction:=WdCollapseDirection.wdCollapseEnd    '***** Add new line    Selection.TypeParagraph    '***** Add text or whatever    Selection.TypeText psTextEnd Sub
  3. Replace the line Selection.TypeText psText with whaterver it is that you want to add - my example just enters the text-string from the sub parameter.