Include macro and button in document

S

Strømdahl

In some cases I need to incude the makro and a button to the document. I have
a specal print button in my template that makes a letter mail merge to the
printer. The source addresslist is in the document. It works fine as long as
the user has connection to the template.

I need the macro to work when I send it to others on mail or user take the
dokument to computers that don't have connection to the template.

How do I include the the mcro in the document?

How do I make a button in the document that starts the makro?
 
C

Charles Kenyon

Try sending them the template? It has the macro.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
S

Strømdahl

That's not an option for me. The document is generated from a CRM system with
data (Casenumber, reciever) and the template file is not accessable for the
user.

I found a solution to the first question:
Sub inkluderMakroIDok()
Dim templateName, fileName, macroModulename

templateName = ActiveDocument.AttachedTemplate.FullName
fileName = ActiveDocument.FullName
macroModulename = "PrintMakro"

Application.OrganizerCopy _
Source:=templateName, _
Destination:=fileName, _
Name:=macroModulename, _
Object:=wdOrganizerObjectProjectItems
End Sub

But I still have a problem with adding a button for the macro.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top