Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2021, 02:16 AM
Bikram Bikram is offline Unable to access buildingblocks through vba Windows 10 Unable to access buildingblocks through vba Office 2007
Advanced Beginner
Unable to access buildingblocks through vba
 
Join Date: Jul 2021
Location: Nepal
Posts: 97
Bikram is on a distinguished road
Default

Thanks a lot for the reply, Sir. The code you provided worked awesomely and inserted the buildingblock I wanted to insert but
ActiveDocument.AttachedTemplate.BuildingBlockEntri es("heading").Insert Where:= _
Selection.Range, RichText:=True
still shows the error 5941.

For i = 1 To Templates(oTemplate.FullName).BuildingBlockEntries .Count
If Templates(oTemplate.FullName).BuildingBlockEntries (i).Name = strBuildingBlockName Then
Templates(oTemplate.FullName).BuildingBlockEntries (strBuildingBlockName).Insert _
Where:=Selection.Range
'set the found flag to true
bFound = True
'Clean up and stop looking
Set oTemplate = Nothing
GoTo lbl_Exit
End If
Next i
This part inserted the buildings blocks I needed. But when I tried


Dim oTemplate As Template
Set oTemplate = ActiveDocument.AttachedTemplate
Templates(oTemplate.FullName).BuildingBlockEntries ("heading").Insert _
Where:=Selection.Range
It again shows error 5941. Sir, can you please suggest what may have caused this problem and how can i solve this?
Reply With Quote
Reply

Tags
building bl, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to access buildingblocks through vba Unable to access picture layout settings. wadori Word 3 12-02-2020 01:20 PM
Alias email - unable to access folders prgwd Outlook 0 01-17-2020 09:43 AM
Using FieldCodes, AutoText, BuildingBlocks ptmuldoon Word 5 01-02-2015 01:33 PM
Unable to access attachments on older emails charon Outlook 0 10-31-2013 05:52 AM
Unable to access Online Templates and Clipart via Office programs LostAngles Office 1 02-10-2012 07:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:22 PM.


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