Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-22-2017, 07:03 PM
macropod's Avatar
macropod macropod is offline Recording code to create Autotext entries Windows 7 64bit Recording code to create Autotext entries Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There are many things macro won't record, including most Ribbon actions. In any event, when creating code, the macro recorder is about as smart as a box of rocks.

The code you've posted as Macro3 is missing some required BuildingBlockEntries.Add parameters. The required parameters are:
• Name
• Type
• Category
• Range
The macro recorder should have recorded all of the required parameters, but evidently it doesn't.

For your purposes you'd need something like:
Code:
Sub Demo()
ActiveDocument.AttachedTemplate.BuildingBlockEntries.Add _
  Name:="WEL", Type:=wdTypeAutoText, Category:="General", Range:=Selection.Range
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
word vba macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making AutoText entries available to the Outlook email editor Jennifer Murphy Word 8 01-03-2017 03:51 PM
Recording code to create Autotext entries alphabetize a list (manual index) with entries and sub-entries shmu Word 5 08-01-2016 11:15 PM
UserForm of Autotext Entries ptmuldoon Word VBA 11 02-13-2016 09:36 AM
Using Word autocorrect and autotext entries in outlook dswapp Outlook 2 11-24-2010 10:18 AM
Maintaining AUtotext Entries from an external table. kelzud Word Tables 0 07-28-2009 01:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft