How to center selected text in document window?

I'm using Word.select( SelectionOptions.REPLACE_WITH) to iterate through a list of words in a document. It would be handy if any off-screen selections could be automatically scrolled into the document window, as with Find/Change. Is there any way to script this?
Thanks in advance --
Steve

Curiously enough, there doesn't seem to be one specific function for that (which may explain the erratic way InDesign sometimes does this). I can't remember off-hand where I saw this trick, but the following works a treat:
app.layoutWindows[0].zoomPercentage = app.layoutWindows[0].zoomPercentage;
-- right after your select line.

Similar Messages

  • How do you highlight text in document in Pages

    How do you highlight text in document in Pages

    but Pages is NOT a 3rd party app.  it's an application that's programmed by apple.  it's supposed to act something like Word in MS office, but that is not at all true. 
    choices for editing text, highlighting, et al., like what you find in MS Office Word, should be immediately available whenever you are inside of a Pages document, but that is not the case. 
    don't you wish that when you buy an apple app for apple/macs that is supposed to be like a windows something or another that it really is? 

  • How to programatically select text for editing in an af:inputText control?

    Hello, I am new to jdeveloper 11.1.1.3.0 and have searched and searched for info. I must be using the wrong terms as I cannot find any info or example on how to programatically select text for editing in an inputText field.
    My request is to change an existing app so when the user presses a button, control should go to the inputText control (this part works, see existing backing bean code from another developer below) but automatically select the text within for editing by the user (saving the user from having to select the text first before editing).
    Backing bean code to set the focus to an inputText field:
    * sets the cursor to the given component id
    * @param  componentId of item on page
      public void setFocusOnUIComponent(String componentId) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExtendedRenderKitService service =
          Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
        UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
        service.addScript(facesContext,
          "Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
      } I hope this isn't a dumb question and would appreciate it if someone can steer me in the right direction.
    Thank you for any info,
    Gary

    Hi,
    not a dumb question at all. Before answering it, here some comments on the code you pasted in your question
    1. UIComponent uiComponent = facesContext.getViewRoot().findComponent(componentId);
    This code line is not used at all in your method. So it seems you can get rid of it
    2. "Component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); Component.focus();");
    I suggest to change it to
    "var component = AdfPage.PAGE.findComponentByAbsoluteId('" + componentId + "'); component.focus();");
    as it is better coding practice to have variable names starting with a lower case letter and being flagged with the "var" identifier
    For pre-selecting text in an an input component, there is no API available in ADF Faces, which means you need to reach out to the rendered HTML ouput. To access the markup for the rendered component, you can try
    var markup = AdfRichUIPeer.getDomContentElementForComponent(component)
    If this markup returns the HTML input component then you can use JavaScript you find on the Internet to select the area of it. If it does not return the input component then you may have to use
    document.getElementById(componentId+'::content')
    Note however that working directly with generated HTML output bears the risk that your code breaks when - for whatever reason - the ADF Faces component rendering changes in the future
    Frank
    Frank

  • How to output particular text in main window only in first page

    Hi experts how to ouput particular text in main window only in first page after that actual transaction data will be continued.....any ideas....Answers will be rewarded.....

    Hi,
    Try this.
    /: IF &PAGE& = '1'
    /: ENDIF
    Thanks,
    Naren

  • How to center the text displayed in a JList

    Hi,
    The width of the JList display area is wider than the text displayed. I tried to center the text displayed to make it look nicer. I had tried using "setAlignmentX(Component.CENTER_ALIGNMENT)" in my own ListCellRenderer class but did not work. Any idea how to center the text?
    Fai.

    Yes, I am using JLabels in my renderer and the following is the code:
    public class MyCellRenderer extends JLabel implements ListCellRenderer {
         private static final Color HIGHLIGHT_COLOR = new Color(0, 0, 128);
         public MyCellRenderer() {
              setOpaque(true);
              setIconTextGap(12);
         public Component getListCellRendererComponent(
              JList list,
              Object value,
              int index,
              boolean isSelected,
              boolean cellHasFocus)
              String entry = (String)value;
              setText(entry);
              setFont(new Font("Ariel", Font.BOLD, 18));
              setAlignmentX(Component.CENTER_ALIGNMENT);
              if(isSelected) {
                   setBackground(HIGHLIGHT_COLOR);
                   setForeground(Color.white);
              } else {
                   setBackground(Color.white);
                   setForeground(Color.black);
              return this;
    Can you point out where to implement the centering logic?
    Thanks,
    Fai.

  • How do I select texte discontinuouly : one word here and another there

    How do I select texte discontinuouly : one word here and another there, etc.

    Use Pages '09.
    Feature has been removed from Pages 5, along with 100+ others.
    Peter

  • How do I select text in a PDF document?

    I have a text-based PDF document, but I can only select text by restarting the reader. Once I select "Take a Snapshot" I can't select text anymore. How do I switch back to select text? I tried right-clicking on the document but I don't see any "selection" tool. I am using 11.0.3 under Win 7.

    Just tested this (Reader 11.0.3 on Windows XP), and your scenario is exactly so.
    I have been able to go back to get the Select Tool by clicking on the Highlight tool in the Toolbar, then right-clicking on the document.
    But it's definitely a bug in my view.

  • How do I select text from multiple pdf pages using Microsoft Document Imaging

    Hello.  I have scanned 3 pages and saved to pdf, now in Microsoft Document Imaging I can only select text from the first page and cannot select text from the other 2 pages.  Is there a way to select multiple pages?
    Thank you.
    Cat

    Why don't you ask in a MS forum? This forum is for an Adobe product and I have no idea why you are asking about Microsoft Document Imaging here.

  • How to read long text in Document line item

    Hi,
    How to read long text in FI Document line item.

    Use Read_text function module.
    you need to pass
    ID
    LANGUAGE
    NAME
    OBJECT   to the function moduel
    To find the Text id name language and object these are the following steps. Example: FB02
    1. goto FB02, Enter Document number
    2. from menuselect Goto>Header-->header Text..... New window will be displayed 
    3. select the Header Text. here you can see all the text. 
    4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper. 
    5. in the Next window you will find Text Name. Text ID, Language. etc...
    Regards,
    Lalit Mohan Gupta.

  • How to search for text in document

    How do you search text within a document on the Samsung Galaxy 10.1? I click the search icon, enter the text to search and nothing happens. The only options I see are a circled "x" and "Cancel". The program does not automatically go to the entered search string and I cannot find anyway to cause the program to find the words. Thanks,

    Once you have typed your search term in, you need to tap the "enter" key on the keyboard. Once you do, the keyboard should close, and you should see the first instance selected.
    There will be two Arrow buttons in the bottom center of the screen to go back and forth through all of the instances of this word in the document.
    If the word could not be found, then a message displaying "search term" not found will appear at the bottom of the screen above those buttons.

  • How to center a text in numbers

    I am having a little bit of a hard time trying to center a text between 3 or more columns.... how can I do that?

    Threre are a few options:
    1) select the three cells and merge them, then enter the text and open the cell formatter and center the text horizonatlly.  NOTE:  merging cells often causes unexpected problems
    2) create a text box and type the text, then format as horizontally centered.  Place the text box over the  cells, set the fill pattern to the same as the cells
    3) create another table to be the header :
    and set the cell width for one cell to be the same as three in the "other" table
    There are porbably more ways than this.  Hopefully one of these will work for you or you will suggest another that works.

  • Shortcut for activating editor when one selects something in document window?

    Hello to the people who know Dreamw. a bit better then me....
    I just try to find a trick that maybe anyone knows out here?
    When you select some text in the document window, you see the
    cursor at that place in the code-editor. Is there a shorthand to
    activate the editor at that point? Now i have to click in the
    editor if i decide to work directly in the code. It could be
    usefull: searching and locating in the document window and then
    with a shortcut continuing to write in the editor.
    Thanks for any help

    I just click on the 'thumb' in the scrollbar for code
    view....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "jojo1971" <[email protected]> wrote in
    message
    news:fq3qjr$qle$[email protected]..
    > Hello to the people who know Dreamw. a bit better then
    me.... I just try
    > to
    > find a trick that maybe anyone knows out here?
    > When you select some text in the document window, you
    see the cursor at
    > that
    > place in the code-editor. Is there a shorthand to
    activate the editor at
    > that
    > point? Now i have to click in the editor if i decide to
    work directly in
    > the
    > code. It could be usefull: searching and locating in the
    document window
    > and
    > then with a shortcut continuing to write in the editor.
    >
    > Thanks for any help
    >
    >

  • How to set selected text color in Spark TextInput

    I'm trying to make Spark TextInputs and MXFTETextInputs look like Halo/MX TextInputs as much as possible, since I have a mix of both Spark and MX TextInputs in my application. I know I can set the
    selection background color to black using focusedTextSelectionColor. How can I set the selected text color to white so it matches the MX white-on-black look?

    This works, if you set the enabled property directly on the s:TextInput:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
        </s:layout>
        <s:controlBarContent>
            <s:CheckBox id="ch" label="enabled" selected="true" />
        </s:controlBarContent>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|TextInput:disabled {
                color: red;
        </fx:Style>
        <s:Group>
            <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{ch.selected}" />
        </s:Group>
    </s:Application>
    It can get a bit trickier when you're setting the enabled property on a parent container, since (I believe) that the child control's enabled properties are still set to true and just the container is disabled. One possible workaround would be to bind the child TextInput control's enabled property to the container's enabled property. That way the s:TextInput should still go to it's disabled state and you can customize the disabled state's styles to have darker text, or whatever else you want.
    <s:Group id="gr" enabled="{ch.selected}">
        <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{gr.enabled}" />
    </s:Group>
    Peter

  • How to get selected text values in a textarea by mouse click?

    Hi Everyone,
    What I am trying to do is to click on some texts in a textarea, then get the selected text value.
    If you guys have used an accounting software called Simply Accounting, you might understand better.
    I list all my customer names in a textarea. What I want is, when I click on one customer, another GUI pops up with this customer's information. My problem is that I don't know how to get the selected text value from a textarea.
    Could anyone give a hand here? Thank you in advance.

    Is there some reason you aren't using a JList or
    JTable to display
    the user names/information?Thank you for es5f2000's reply. You just gave me a better idea! There is not a particular reason I have to use TextArea to list my customers. As long as the component can make my idea alive, I definitely use it. Still, if there is any way to get a selected text value, it will help me a lot with my project. Thank you.

  • How do you select text behind a shape in Pages 5.0?

    I created a document in Pages 4.x in which I used rectangle outline shapes to create nice custom borders both for the page itself and for some contents in the body of document. (I've used text boxes before, but for this particular document the shapes worked much better and allowed for a look I couldn't achieve with text boxes.) Unfortunately, since updating to Pages 5.0, I can no longer select text within the shape spaces. In order to select and/or edit that text, I either have to delete the shapes first, or move them so that I can click inside the body of the document, and then use the arrows to get to the text I need to edit. This is very time-consuming. Is there an easier way to select text in the body of the document without having to move/delete the overlapping shape? This was easy to do in Pages 4.

    Pablo,
    Making the Shape or Text Box a Section Master will put it behind the text without having to delete or move it.
    Arrange > Section Masters > Move Object to Section Master
    and
    Arrange > Section Masters > Move Object to Page
    Jerry

Maybe you are looking for

  • Can i use my husbands upgrade for the iphone 6 promotion

    My line is technically not eligible for upgrade, but my husbands line is (we are on a family plan with my mom). Last time I upgraded, they let me use my husbands upgrade since his was available. Can I do this for the iphone 6 promotion or will they n

  • Pc suite "no connections available"

    Hello I need your help about Nokia PC Suite and Nokia Ovi Suite. I use Nokia PC Suite many years without any problem until last week. After I formatted my pc I reinstalled the latest version of  Nokia PC Suite but when I try to connect my Nokia E71 I

  • Stream from Time Capsule to Apple TV without having the Mac on.

    Is it possible to move my movie content to the Time Capsule and stream to Apple TV without the Mac being on?

  • Logitech Trackman

    Hi, does anyone know how the ball on the Logitech Trackman functions within FCP? http://www.logitech.com/index.cfm/mice_pointers/trackballs/devices/166&cl=us,en I especially want to know if the ball merely controls the pointer or if you are able to s

  • Picture disappears while editing from main screen view in iPhoto.

    Does anybody have any idea why this happens?  Certain pictures will disappear from the main view and I can't edit them at all since I can't see it.  I can see them in the thumbnail and once I exit the edit screen I see it again.  If I revert it shows