Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2018, 05:29 AM
Charles Kenyon Charles Kenyon is offline Macro-inserting text box Windows 10 Macro-inserting text box Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,583
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Here is a macro that would insert the textbox formed using the instructions:
It assumes that both the building block and macro are stored in the same template.



Code:
Sub InsertMyBB()
    '
    ' Assumes that the Building Block is of the type AutoText (wdTypeAutoText)      in Category "General"
    ' See      https://msdn.microsoft.com/en-us/lib...ffice.12).aspx
    '
    ' This is based in part upon contributions from Greg Maxey and Jay Freedman      - any errors remain mine
    ' Written by Charles Kenyon February 2016
    '
   Dim sBBName As String
   Dim sTempName As String
   Dim oBB As BuildingBlock
   sBBName = "_MyText" 'use the name of your building block instead      of "_MyText"
   sTempName = ThisDocument.FullName ' puts name and full path of      template in string variable
   On Error Resume Next
   Set oBB = Application.Templates(sTempName).BuildingBlockTypes(wdTypeAutoText)      _
      .Categories("General").BuildingBlocks(sBBName)
   If Err.Number = 0 Then
      oBB.Insert Selection.Range, True
   Else
      MsgBox Prompt:="The Building Block '" & sBBName &      "' cannot be found in " & _
         ThisDocument.Name & ".",      Title:="Didn't Work!"
   End If
   On Error GoTo 0
lbl_Exit:
   Exit Sub
End Sub
You can download a template with this macro in it from my downloads page.
http://www.addbalance.com/word/downl...acroToInsertBB
Reply With Quote
  #2  
Old 04-16-2018, 06:40 AM
BLUEPUPIL BLUEPUPIL is offline Macro-inserting text box Windows 7 64bit Macro-inserting text box Office 2016
Novice
Macro-inserting text box
 
Join Date: Feb 2016
Posts: 20
BLUEPUPIL is on a distinguished road
Default

Reply With Quote
  #3  
Old 04-16-2018, 06:41 AM
BLUEPUPIL BLUEPUPIL is offline Macro-inserting text box Windows 7 64bit Macro-inserting text box Office 2016
Novice
Macro-inserting text box
 
Join Date: Feb 2016
Posts: 20
BLUEPUPIL is on a distinguished road
Default

Reply With Quote
  #4  
Old 04-16-2018, 06:45 AM
BLUEPUPIL BLUEPUPIL is offline Macro-inserting text box Windows 7 64bit Macro-inserting text box Office 2016
Novice
Macro-inserting text box
 
Join Date: Feb 2016
Posts: 20
BLUEPUPIL is on a distinguished road
Default

1.Draw a text box
2.No Line; No Fill
3.Insert the desired text
4.Tex box wrapping- In front of text
5.Tex box position:
A.Horizontal- Absolute position 0"
to the right of Character
B.Vertical- Absolute position X"
below Line
6.Quick Parts- Save selection
to Quick Parts Gallery
7.Assign short key
Neat and easy thanks to Charles Kenyon
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro-inserting text box Macro for inserting and formatting headers and footers Mike_Lennox Word VBA 4 10-06-2016 12:10 AM
Macro-inserting text box Need Macro for Find and Replace, Inserting logo in Ms-Word. Aswinraj Word VBA 1 06-05-2016 04:33 PM
Macro-inserting text box Inserting and rearranging text by inspecting existing text rok123 Word VBA 9 02-05-2016 07:31 PM
Macro for Inserting Cross-referenced Continuation Headings rdross51 Word VBA 0 01-06-2016 10:20 PM
Macro-inserting text box Inserting key strokes with a macro line ACA Word VBA 4 12-03-2012 04:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:01 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