Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2010
    Location
    Texas
    Posts
    54
    Thanks
    9
    Thanked 0 Times in 0 Posts
    When recording a macro that involves Building blocks (a feature introduced in Word 2007), the macro comes out with:

    WordBasic.CreateCommonFieldBlockFromSel Description:=""

    1) Why is a WordBasic command being used with such a new feature.

    2) Can't a title be added to it?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by ForEachLoop View Post
    1) Why is a WordBasic command being used with such a new feature.
    Good question!

    The macro recorder is imperfect. You probably want to use the built-in VBA methods if you can. For example (based on code sample in the help file):

    Code:
    Dim myNewBuildingBlock as Word.BuildingBlock, _
        myTemplate as Word.Template
    
    Set myTemplate = NormalTemplate ' to add to Normal.dotm, or the template of your choice
    
    Set myNewBuildingBlock = _
        myTemplate.BuildingBlockEntries.Add(Name:="New Building Block Entry", _
        Type:=wdTypeWatermarks, Category:="General", Range:=Selection.Range)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •