![]() |
|
#1
|
|||
|
|||
![]()
I'm developing a procedure template that contains building blocks and macros to use the building blocks to assign them to the ribbon. My problem is how can I share this with other writers. The template will be stored in the Word STARTUP directory by the macros I created use my name in the path. I tried substituting %USERNAME% in place of mine but that doesn't work. Any ideas?
|
#2
|
|||
|
|||
![]()
If the building buildingblocks are stored in the same template as the template contain the code use:
ThisDocument.AttachtedTemplate.... |
#3
|
|||
|
|||
![]()
No it won't return the path. It thought you wanted to work with building blocks
Code:
Sub TT() MsgBox ThisDocument.Name MsgBox ThisDocument.FullName MsgBox ThisDocument.Path ThisDocument.AttachedTemplate.BuildingBlockEntries("Page X of Y").Insert Selection.Range End Sub ThisDocument. Me. The guy running your code. |
#4
|
|||
|
|||
![]()
What's the difference between "ThisDocument" and "ActiveDocument"?
Here's a sample macro. Where would I put your code line? Sub RevSummary() ' ' RevSummary Macro ' ' Application.Templates( _ "C:\Users\robert.ross\Documents\Work\Nawah\Mas ter Templates\New\Nawah Procedure.dotm" _ ).BuildingBlockEntries("Revision Summary").Insert Where:=Selection.Range, _ RichText:=True End Sub |
#5
|
||||
|
||||
![]()
ThisDocument is the document that contains the macro. ActiveDocument is the document open in active window.
If the macro is in the same template as the building block then you could use Code:
Sub RevSummary() ThisDocument.AttachedTemplate.BuildingBlockEntries("Revision Summary").Insert _ Where:=Selection.Range, RichText:=True End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#6
|
|||
|
|||
![]()
gmaxey - are you saying Guessed's solution will not work? I don't understand your MsgBox script. Seems like the other script whould work because it's the same as my macro without the path string.
|
#7
|
|||
|
|||
![]()
I was answering the question that someone posted here and then apparently edited out. Will that return the path? No. But Msgbox ThisDoucment.Path will.
Have you ever heard the old saw "Give a man a fish and he eats for a day ... teach a man to fish and he eats for a lifetime?" The message box script were intended as fishing lessons. Guessed's solution is the same as I provided initially. ThisDocument.AttachedTemplate ... If you would have tried either you would have seen that for yourself. Last edited by gmaxey; 03-12-2015 at 09:57 AM. |
#8
|
|||
|
|||
![]()
Problem solved.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ptmuldoon | Word | 5 | 01-03-2015 08:45 AM |
Using Building Block Gallery Content function on a form with restricted editing | wes228 | Word VBA | 1 | 08-28-2014 08:14 AM |
how to make building block content control determine bb to display elsewhere | jamles12 | Word VBA | 5 | 11-16-2013 11:38 AM |
Building blocks show correctly in dropdown, but wrong building block populates in doc | wordgirl123 | Word | 0 | 10-03-2013 08:30 AM |
How to share macros in Powerpoint 2007?? | proshop | PowerPoint | 0 | 12-20-2009 07:29 AM |