![]() |
#1
|
|||
|
|||
![]()
Its been a while since I've last looked at any VBA, both word and excel and now trying to re-familiarize myself with everything.
I'm working to create a listing of autotext entries for my staff/users to have available to insert into various places in a document. And I'm creating a separate template/addin file that will store all of those autotext entries and load on startup. Now, I want to be create a userform that will list those entries and the user can then insert it into the document. Could someone help me remember/learn how to generate a list of autotext entries, preferable to only list them from a specific file, gallery, and category? Thanks PT EDIT. Slowly Making Progress. I was able to learn how to list out the items in my template/add in file. I hope to learn now how to expand more on this to work with a chained select on the BuildingBlock Type and have a 'preview' of the building block value. Code:
Private Sub UserForm_Initialize() Dim objTemplate As Template Dim oBuildingBlock As BuildingBlock Dim i As Integer Dim sPath As String ' Set the template to store the building block sPath = Environ("APPDATA") & "\Microsoft\Word\STARTUP\ReportMacros.dotm" Set objTemplate = Templates(sPath) For i = 1 To objTemplate.BuildingBlockEntries.Count Set oBuildingBlock = objTemplate.BuildingBlockEntries.Item(i) Debug.Print oBuildingBlock.Name + vbTab _ + oBuildingBlock.Type.Name + vbTab _ + oBuildingBlock.Category.Name + vbTab _ + objTemplate.FullName If oBuildingBlock.Type.Name = "AutoText" Then ComboBox1.AddItem oBuildingBlock.Value End If Next End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Userform calls other userform, then populate worksheet | Lehoi | Excel Programming | 0 | 02-03-2016 02:58 PM |
VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
![]() |
BoringDavid | Word VBA | 5 | 05-09-2014 09:08 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 |