Referencing a command button

I have a Word (2010) template document which pops up a user form on Open.  The user form solicits info to go into the document and has a button allowing the user to post the info to the document, and then Save and Email it.   Or the user can
click another button to just Save the document for editing and emailing later.  So, there is a command button in the document itself allowing the user to Email the document when it is finally ready.  I want to delete or disable the command button
in the document if the user chooses to e-mail the document from the user-form.
I can't figure out how to reference the button in the document.  I have tried ActiveDocument.Shapes("btnEmail").delete and ActiveDocument.InlineShapes("btnEmail").delete and .Enabled=False with and without quotes to no avail. In
each case I get one or another error message about member not found or property or method not supported.  Shapes.Count returns 0 members, and InLineShapes.Count returns 3 members.  I have tried code to delete every member of the InLineShapes
collection, and 3 items are deleted (a couple of horizontal lines and something else), but the command button survives.
Any suggestions?
Thanks,
Peter

Well, I deleted the command button and put it back.  It now appears in the Shapes collection where I can get at it. I can now enable/disable it with:
ActiveDocument.Shapes(1).OLEFormat.Object.Enabled = True/False
but only because it is the only (or at least the first) shape in the collection.  If there were more Shapes and I wanted to pick this one out by name I can use:
Dim shp As Shape
For Each shp In ActiveDocument.Shapes
        If shp.OLEFormat.Object.Name = "btnEMail" Then shp.OLEFormat.Object.Enabled = False
Next
Also, I discovered that in the Shapes collection, my button's name is "Control 5", so I can also use :
ActiveDocument.Shapes("Control 5").OLEFormat.Object.enabled=true/false
But if I have created the button with the name "btnEMail", it seems like I should be able to refer to it directly and not by having to loop through the Shapes collection to find it, and not by having to use debug.print to discover its Shapes
collection name.
I know that in Excel, I could reference a button on a worksheet very simply with:
Sheet1.btnEMail.Enabled = True/False
What am I missing that explains why Word is so different and cumbersome about this?
Thanks,
Peter

Similar Messages

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

  • I just statred Flash CC for the first time and it seems that the text within the pop-up window (dialog box) is mis-aligned and not allowing me access to the command buttons, nor all the text. (ie: the NEW Template Box, can't see but 2/3 of the content)

    I just statred Flash CC for the first time and it seems that the text within the pop-up window (dialog box) is mis-aligned and not allowing me access to the command buttons, nor all the text. (ie: the NEW Template Box, can't see but 2/3 of the content) is there a fix to this problem? using 8.1, Monitor is a high res.2560x1440.

    Another View.
    the GUI is so hard to read (so small) I enlarge my Ps UI by the instructions below...which helped a lot.

  • I am attempting to upload multiple photos on a macpro from a cd.  I am used to a pc.  I tried using the command button to select multiples but it does not work.  Please advise

    I am attempting to upload multiple photos on a mac pro from a cd.  I have tried holding the "command"button down to select multiple photos but it does not work.  Please advise.  Thanks,John

    why not sort by (name, date, etc) and Click on 1st and Shift-Click on last.
    Might work better to copy or import to a project folder.
    https://discussions.apple.com/community/ilife/iphoto
    http://www.apple.com/support/iphoto

  • How to open new browser window on click of command button

    Hi,
    We have a requirement to open an image in new window when a command button is clicked. Is there any sample explaining how to do that?
    Thanks in Advance,
    Pradeep

    Hi,
    I have to load an applet viewer in the new browser window. I have URL to the PDF.
    I ma able to load the applet viewer in new browser window using javascript. But I have to load the new PDF if the same window in already opened.
    The issue here is , i am loosing the window handle if the parent page is refreshed. I want to store the window handle in session scope variable and use the same.
    How do i update the session scope variable using javascript?
    Thanks and Regards,
    Pradeep

  • Adf faces command button, bindings and ejb 3.0 persisting problem

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

  • How to open an pdf report On click of some command button in adf

    Hi,
    I have to generate some pdf report or some pdf document on click of some command button .Could any one please tell me how to achieve this.
    suggestion would be appreciated,
    Regards
    Vinay kumar

    So what you're saying is the PDF already exists on your web server, and all you want to do is navigate in the browser from your ADF application to the PDF, yes? If that's correct, let's assume you're PDF exists at:
    http://www.acme.com/someCustomPath/myFantasticReport.pdf
    Consider the <af:goButton> or <af:goLink> controls, which include the destination attribute. As such you'd do something like this:
    <af:goButton destination="http://www.acme.com/someCustomPath/myFantasticReport.pdf"/>As you can see the "go" controls are for navigating to resources not inside your ADF application, while the "command" controls are reserved for navigation among resources in your application.
    In order to generate the destination URL, just replace the destination attribute with an EL expression that retrieves it's value from a backing bean:
    <af:goButton destination="#{myBean.giveMeTheUrl}"/>Regards,
    CM.

  • I want to create a command button for my Numbers spreadsheet.

    I am creating a Numbers spreadsheet and need to have a command button. It is really simple in Excel so I assume Numbers would be too.
    Please advise.
    Thanks,
    Hank

    A88,
    I've linked your second post of this question to this thread, where the discussion has already started.
    Next step would be to respond to Watne's question:
    "Can you describe what you are trying to do so we can suggest a solution?"
    Regards,
    Barry

  • Trying to change the text of the command button.

    Hi.,
    Am using jdeveloper 11.1.1.6.,
    I have dragged and dropped a command button in my jsff page.
    When there is no record in my VO which dragged and dropped as a af:form the button will act as a create insert so that the text of the button should also be create Insert. If there is record the button should act as a update so that the text should also be update. I have used the follwoing code to change the text accordingly.
        public void settext(ActionEvent actionEvent) {
            // Add event code here...
            BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            System.out.println (e);
            if ((e == 0)) {
                myButton.setText("CreateInsert");    // Null pointer exception occurs
            } else {
                myButton.setText("Update");  //null pointer exception occurs
        }Can any one pls help me?

    Hi Timo!
    This was the thing which i have did.
    I have dragged and dropped a command button to my jsff page.
    When i press the button a popup will show which ask the confirmation from the user.
    This is the code which i have written in my managed bean.
        public String delete_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            Commit();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public void deleteItem(DialogEvent dialogEvent)
            if (dialogEvent.getOutcome() != DialogEvent.Outcome.yes)
                delete_action();
              return;
          }I have used the EL Expression in my another button which will change it property according to the values in my row.
    #{bindings.EssEeoDemInfView1Iterator.estimatedRowCount gt 0 ? 'Update':'Create Insert'}For this button i have used the following code in my managed bean.
        public String update() {
             BindingContainer bc = getBindings();
            DCIteratorBinding dcIter =
                (DCIteratorBinding)bc.get("EssEeoDemInfView1Iterator");
            int e = (int)dcIter.getEstimatedRowCount();
            if ((e == 0)) {
                  CreateInsert();
            } else {
                   Commit();
            return null;
        }When i initially delete the record the button has not been changed to createinsert it remains as update. When i press the update am getting NULL pointer exception in CreateInsert() and Commit();

  • ADF JSF 10.13 how do you reference a binding from a command button?

    I have developed the following code as a model as I am trying to utilise ADF JSF without using a database.
    I have a collection called School. This has the appropriate operations that populate the school with a number of Child. A Child simply has a firstname and a surname.
    I have generated data controls for these collections and created two JSP pages and added a navigation link as follows:
    index.jsp --> goToSchool (navigation) --> school.jsp
    I have then added a command button to the index.jsp page. When the button is then pressed the school.jsp page is displayed. This works correctly.
    I would like to override the action of the button though so that before the navigation is executed I can get a handle on the school collection and populate it so that it will be displayed on the school.jsp page.
    I have previously done this in 10.12 when I had the following setup:
    index.jsp --> getSchool (dataAction) --> school.jsp
    by overriding the getSchool dataAction.
    I have looked through the 10.13 ADF user guides and tried various different things but have not managed to successfully acheive my goal of populating the school collection when the button is pressed prior to navigating to the school.jsp page.
    I would appreciate it if you could offer any advice, and if possible let me know the recommended best practices to acheive this.
    Thanks in advance for your help
    David

    Check out the ADF Tutorial (TopLink edition) chapter 5 has a section called:
    Adding a Drilldown Link
    I think this is what you are looking for.
    http://www.oracle.com/technology/obe/ADF_tutorial_1013/ADF_tutorial.pdf

  • OSX Lion 10.7.4 can't be installed, Can't erase, command button is locked, but disk is found, I'm stack after the agreement page, no partition found

    I have a mac-book pro mid 2010, the original mac o.s is version 10.6.3 snow leopard
    the hard disk crashed, so i decided to buy another disk, 160gig Sata
    i downloaded mac o.s version 10.7.4, and decided to fresh install from a dvd, but durint installation, on disk options, it can't be partition, the command button for partitioning is locked, even in the erase menu bar at mac installation window, and I can't reinstall from version 10.7.4
    I've read that when the mac is a mac-book pro on mid 2010, it should used the default mac o.s version.
    I'd like to hear some experts here about mac installations,
    the hard disk is found, at disk1(only in disk utility option), but it can't be partition or erase, so I can't reinstall a fresh copy of mac.
    I'm stuck here:
    Part Two: Installing the operating system
       1. When the Mac OS X L.I.O.N Installer screen appears, click Continue.
       2. When the license agreement appears, click Agree.
    then can't continue because no disk was found, I have already formatted it with HFS(not HFS+) in the other Unit(using windows macdrive)
    but, you think because of the hfs only and NOT hfs+?
    I'm stuck here:
    Part Two: Installing the operating system
       1. When the Mac OS X L.I.O.N Installer screen appears, click Continue.
       2. When the license agreement appears, click Agree.
    then can't continue because no disk was found, I have already formatted it with HFS(not HFS+) in the other Unit(using windows macdrive)
    but, you think because of the hfs only and NOT hfs+?
    thanks

    I think there's nothing to do with the drive manufacturer,
    I used the macDrive for windows, and format it to HFS(not HFS+)
    Ok,
    Actually I have this folder/files,
    InstallMacOSX.pkg (folder)
    Inside InstallMacOSX.pkg(folder) it has files:
    InstallESD.dmg(using ULTRAISO was burned to dvd)
    This files are NOT included in the burn dvd image:
    Bom
    PackageInfo
    Payload
    Scripts
    This files/folder is outside InstallMacOSX.pkg(folder):
    Distribution(file)
    [TOC].xml(file)
    Resources(folder)
    The original .DMG file was MOsXLeoneDieciSetteDue.dmg(but this is fake, it's a Xar compressed)
    The valid .DMG file is inside the .XAR, so I extracted it, and found those files and folders.
    So, I'll include that in the burned dvd?
    thanks

  • How to assign a macro to a command button in 2007

    I apologize, I know this is on the web somewhere, but I've spent the last 2 1/2 hours fishing for answers on Google and forums and everything I find either assigns a macro command to the quick bar or in text, but I want to assign it to a command button,
    or anything that can be clicked to run a macro.  In Excel I can just right click on a macro button and use the option "Assign Macro", but I've not been able to find anything similar in Word.  I'd think being another Office product it would
    be a similar option in Word, but I guess not. 
    So my project is taking information from Excel via linked information to fill out a Word document, so I need to use CTRL-A to select all text, then hit F9 to update the fields, then print as a PDF and send to the customer, and it works beautifully. 
    Now I need to share this with my team and I'm trying to make it as foolproof as possible so I was going to do all of this via macro and assign it to a macro button, or I guess it would be a Command Button in Word? 
    I also don't want the command button to show when I print the document.  Is all of this fairly simple to do in Word?
    Thank you in advance for your help!!!

    Hi Arun ,
    Thanks for the reply,
    This is the actual scenario,
    I need to allow user to querying using a particular atrribute say A1 but applying A1 directly as a criteria on my base query along with other criteria will not fetch any details.
    Instead
    I need to fire the same query with A1 alone initially and on top of the fetched results i need to apply the other criteria
    OR
    I need to get the A1 from user and fetch some other attribute let's say A2 corresponding to A1 and this A2 has to applied as the new attribute along with the other attributes.
    Can this be achieved.
    Regards
    Siva
    I am using jdev 11.1.1.6

  • How can LabVIEW press a command button in access form?

    Situation: access database with a command button, who generate a code after pushing
    Task: LabVIEW open the access database, pressed the command button and read out the code
    Status:
    use activeX to open the access database - ready
    press the command button - open
    read out the code - open
    Problem: Is there a possibility that LabVIEW press automatically the command button in the access form?
    Solved!
    Go to Solution.

    First off, you are confusing your terms. Access is not a database. It's an development environment for creating applications that use databases. By default, Access uses a DBMS called Jet that is built into Windows, but it can use others like SQL Server or even Oracle.
    Second, in terms of pushing the button, that is totally dependent upon what functionality Access' ActiveX interface chooses to expose to external applications.
    Third, what does the button actually do? The statement, "..generate a code.." is meaningless. Does it perform a query? Does it generate a report? Does it modify records?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Displaying pdf report in pop page by command button.

    Hi
    I am jdev 10.1.3.3 .I am displaying an pdf report on click of command button like this.
    FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.acme.com/someCustomPath/myFantasticReport.pdf");
    But problem is this.It is displaying on same window.I want to display it in new window or pop window..Probelm is that i am redirecting the page.
    Is there any other way to display in new window.Please help
    any help would be helpful

    Hi,
    check this: http://thepeninsulasedge.com/frank_nimphius/2007/09/11/adf-faces-showing-reports/
    Frank

  • How to create an ADF table which has a command button column?

    Hi
    Thank you for reading my post
    how i can create a tabl that one of its column is a command button.
    when i press the command button it will , for example delete that row or do some action.
    indeed i want to know
    -how to have a command button column
    -how to find the rowID or some row identifier that help me locate that row in the database.
    thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Rainer Wagner ([email protected]):
    Imagine a table T_Q with columns C_1, C_2, C_3 and UN_123.
    C_1, C_2 and C_3 are all numeric and given by the user.
    UN_123 has to be a calculated sequence number starting by 1 and incremented by 1 for each combination of C_1, C_2 and C_3, i.e., the sequence number depends on the key values C_1, C_2 and C_3.
    Could anybody provide a code sample on how to create a BEFORE INSERT trigger , which calculates the value of the column UN_123 based on the values of C_1, C_2 and C_3 ??
    Premise: Rather than using any sequence, the trigger code should only be based on the table T_Q<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • Workflow content in portal.

    We have enabled a workflow in UCM and documents are correctly participating in workflow. We are showing document in our portal application using content presenter. If a contributor creates a new document, it goes for approval. Now if approver login i

  • Query timeout in ADF BC

    Hi all, I had a quick look, but couldn't find the answer: is there any way to set a query timeout for ADF Business Components queries, such that if a VO query takes more than x seconds, we will time out? John

  • Setting up Service desk Management

    Hi, We have EP 6.0 SP14. We want to set up Service Desk Management with  solution Manager. Could any one guide the set up steps. Thanks in advance Pradnya

  • Mapping points on distance?

    Does anyone know of java program that can take a matrix of distances between some places and map these places by plotting them? For example, if I have the matrix      A     B     C     D A    0     12    3      6 B   12     0     4      7 C    3    

  • How do you unlock a phone when you dont know the password?

    how do you unlock a phone when you dont know the password?