Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2007-08-01 15:17:38

henley.tim
Member
Registered: 2007-08-01
Posts: 1

Disable e-mail attach button

COuld you tell me how to disable the attach pdf to e-mail button?


My Product Information:
Acrobat Pro 8.1 / Windows

Offline

 

#2 2007-08-04 22:21:00

dthanna
Member

Registered: 2007-04-25
Posts: 43

Re: Disable e-mail attach button

Where is the button located? If you are asking about the one's in MS-Office apps, the answer is No.

As for within Acrobat - You can create a JavaScript program (drop it in the JavaScript folder) that removes various items from the menus and toolbars.  Package this with your distribution.  Upon launch, if the user is fast enough, they may see it on the menu briefly.  However as soon as the JS is interpreted the items will dissappear.  It won't stop them - a quick internet surf and some bright mind will just delete/rename the file.  But it will, like a luggage lock, stop most people.

I have used this "trick" to remove things from our build as part of our corporate distribution with a great deal of success.

Offline

 

#3 2008-03-07 00:12:42

usera
Member
Registered: 2008-03-06
Posts: 10

Re: Disable e-mail attach button

dthanna wrote:

Where is the button located? If you are asking about the one's in MS-Office apps, the answer is No.

As for within Acrobat - You can create a JavaScript program (drop it in the JavaScript folder) that removes various items from the menus and toolbars.  Package this with your distribution.  Upon launch, if the user is fast enough, they may see it on the menu briefly.  However as soon as the JS is interpreted the items will dissappear.  It won't stop them - a quick internet surf and some bright mind will just delete/rename the file.  But it will, like a luggage lock, stop most people.

I have used this "trick" to remove things from our build as part of our corporate distribution with a great deal of success.

Thanks, could you please provide some sample code here for us to learning?

Offline

 

#4 2008-03-08 02:42:41

maryfleck
Member
Registered: 2008-03-07
Posts: 3

Re: Disable e-mail attach button

DTHANNA, would love to know "how to" from your explanation.  Please advise.

Offline

 

#5 2008-03-10 11:45:20

dthanna
Member

Registered: 2007-04-25
Posts: 43

Re: Disable e-mail attach button

Sure,

In general, three steps:

1) Find out what the menu names are for the product you are using.

A comprehensive list is not found in in a book or manual.  So, roll your own tool.

Create a brand new (clean) PDF.  File | Create PDF --> From Blank Page (hold Shift key down in A7 and it will appear)

Create a LARGE text box (form object) - almost the entire page.
Give it the name of 'f' - yup, just the single character.  It works with the code below.

Create a button (use form tools).
Have that button execute a JavaScript.
Use this code:
------------------------
//* Generate a list of all menu names.*//

var menulist = "";                                                  // String to build formatted list of names

function FancyMenuList(m, nLevel)                                   // Recursive function to format list.
{
        var s = "";
        for(var i = 0 ; i < nLevel; i++) s += "   ";               // Steps to right on each level (+1)
        menulist = menulist + s + "+--" + m.cName + "\n";           // Formats printout
        if (m.oChildren != null)                                   // Breaks up one level of recoursion
                for (var i=0; i < m.oChildren.length; i++)         // Loops through each child element
                        FancyMenuList(m.oChildren[i], nLevel + 1); // Drops down one level when child +1's
}/* Put script title here */

//var f = this.getField("ouput");
this.getField("f").value = " ";                                    // Initialize output
var m = app.listMenuItems();                                       // Grap the initial list of menu items
for ( var j=0; j < m.length; j++) FancyMenuList(m[j],0);           // Go through each menu item in the list
this.getField("f").value = menulist;                               // Populate the output textbox.
--------------------------------------------------
Save your PDF.

BTW - I received the above code from somewhere (but cannot remember where) and modified as needed.  Here is your kudos if the above was your code.

Click on the button - after a second you will get a list that looks like this..

+--File
   +--Open
   +--Organizer
      +--OpenOrganizer
      +--AddToOrganizer
      +--OrganizerNewCollection
   +--endOpenGroup
   +--NewDocument
      +--NewDocFromFile
      +--NewDocCombineFiles
      +--Scan
      +--Web2PDF:OpnURL

The leaf nodes are the actual menu names with the root nodes being the major menu categories.  Makes it easy to find things.

Copy the entire list (it's too big for the text box) into Notepad or similar editor.

Place cursor in front of the + in at '+--File' then press CTRL+SHIFT+END - this will hightlight all the text.  Then CTRL+C to copy. 

Paste it into your favorite editor.

Now you have your list to dig through....

Note: The above will also work in Reader - you just cannot save the PDF.

2) Create the folder level JS.

Create a .JS file (Notepad works just fine) and drop it into
C:\Program Files\Adobe\Acrobat >your version<\Acrobat\Javascripts

It will have nothing more than a series of app.hideMenuItem(""); entries and will look something like this:
/* Begin Code */
//app.hideMenuItem("SystemInformation");
app.hideMenuItem("AdobeExpertSupport");
//app.hideMenuItem("OnlineSupport");
app.hideMenuItem("Updates");
app.hideMenuItem("RegisterProduct");
//app.hideMenuItem("AdobeOnline");
//app.hideMenuItem("AccessOnline");
//app.hideMenuItem("DetectAndRepair");
//app.hideMenuItem("AboutAdobeExtensions");
//app.hideMenuItem("AboutExtensions");
//app.hideMenuItem("UsingExtensions");
app.hideMenuItem("BuyAcro");
/*End Code*/

The '//' entries are just commented out as we use the same file for multiple products - just commenting/un-commenting as needed.

Use the above list to determine exactly what text place the parameter for app.hideMenuItem("");

3) Enable menu code execution.

From Acrobat Preferences:  JavaScript make sure the following are enabled (checked)
Enable Acrobat JavaScript
Enable menu items JavaScript execution privileges

For a rollout here are the registry entries:
HKEY_CURRENT_USER\Software\Adobe\Adobe Acrobat\>your version<\JSPrefs
Name: bEnableJS
Type: DWORD
Value: 1

Name: bEnableMenuItems
Type: DWORD
Value: 1

Hope this helps.

Holler if you have any additional questions.

Thanks

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

AcrobatUsers.com  >>  User Groups • News • Events • Articles • Blogs • How To • Resources • Member Log in