I've created a pre formatted text box and added it into my macro file (.dotm) as a Building Block (Insert >> Quick Parts...)
I've to insert the text box while running my macro code.
Let's say basic macro process:
01. Cut selected text
02. Set left and right margin into 72pt
03. Insert Text box (By running the following code)
Code: Select all
Application.Templates( _
"C:\Program Files (x86)\Microsoft Office\Office14\STARTUP\MyMacros.dotm" _
).BuildingBlockEntries("MyTextBox1").Insert Where:= _
Selection.Range, RichText:=True
05. Paste Text
Macro works as I needed. Final result: My question is, this macro is only works for my system (MS Office 2010 32bit). Reason is the building block call reference as the following path:
C:\Program Files (x86)\Microsoft Office\Office14\STARTUP\
Is there any alternative way to compatible this macro to any MS word version?
Many Thanks!