Deselecting text in Word

How can I deselect text in a document once it has been selected and edited?
I can't find this in the documentation and none of the obvious commands seem to work: deselect, select none, etc.
The below script works fine but I want to deselect myRange.
tell application "Microsoft Word"
activate
open "Photo [OSX]:Users:home:Desktop:Calendar.doc"
insert text textCalData at end of text object of front document
set theCount to count of paragraphs of active document
set myRange to create range active document start (start of content of text object of paragraph 3 of active document) end (end of content of text object of paragraph theCount of active document)
select myRange
set all caps of font object of selection to true
end tell
Pedro
G5   Mac OS X (10.3.9)  

You may try to set insertion point to the same point:
set myRange to create range active document start (start of content of text object of paragraph 3 of active document) end (start of content of text object of paragraph 3 of active document)
or to move the cursor with keystroke:
tell app "Microsoft Word" to activate
tell app "System Events"
tell process "Microsoft Word"
keystroke (ASCII character 29) -- arrow right
end
end

Similar Messages

  • JTextArea artifacts when selecting/deselecting text

    I just bumped up against a font rendering issue with JTextArea. I have no doubt that it's a bug, but does anyone know of a workaround?
    Run the program below and select/deselect text by double-clicking words. The text is painted in a different location when selected and deselected. Try selecting by dragging the mouse or pressing shift and left/right arrow keys -- same problem, but the actual pixel location of the artifacts sometimes differs depending on the selection start and end, and the way the text was selected (keyboard/mouse drag/double click).
    Now try selecting the last word ("dog") by double clicking.import java.awt.Font;
    import java.awt.font.TextAttribute;
    import java.util.HashMap;
    import java.util.Map;
    import javax.swing.*;
    public class TextAreaProblem {
      public static void main(String[] args) throws Exception {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            new TextAreaProblem().makeUI();
      public void makeUI() {
        Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
        attributes.put(TextAttribute.FAMILY, "Arial");
        attributes.put(TextAttribute.SIZE, 36.0);
        attributes.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
        attributes.put(TextAttribute.TRACKING, TextAttribute.TRACKING_LOOSE);
        Font font = Font.getFont(attributes);
        font = font.deriveFont(attributes);
        final JTextArea textArea = new JTextArea("The quick brown fox jumps over the lazy dog.");
        textArea.setFont(font);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        JFrame frame = new JFrame();
        frame.add(new JScrollPane(textArea));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(850, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\Darryl>java -version
    java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)Any tips for a workaround will be much appreciated.
    Thanks, Darryl

    The fix using System.setProperty worked 100% for all font and attribute combinations I tried -- thanks again.
    2) Does it work to set the property after the GUI is already created and shown? (shall test that myself in a few hours, but would be nice to know earlier :)No. However, you may set this property as a component client property (on the JTextComponent), but before that component is made visible.This didn't work for me. I tried both putClientProperty and getDocument().putProperty, as suggested in the other thread. What did I miss?import java.awt.Font;
    import java.awt.font.TextAttribute;
    import java.util.HashMap;
    import java.util.Map;
    import javax.swing.*;
    public class TextAreaProblem {
      public static void main(String[] args) throws Exception {
        //System.setProperty("i18n", Boolean.TRUE.toString());
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            new TextAreaProblem().makeUI();
      public void makeUI() {
        Map<TextAttribute, Object> attributes = new HashMap<TextAttribute, Object>();
        attributes.put(TextAttribute.FAMILY, "Arial");
        attributes.put(TextAttribute.SIZE, 36.0);
        attributes.put(TextAttribute.TRACKING, TextAttribute.TRACKING_LOOSE);
        attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
        attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
        Font font = Font.getFont(attributes);
        font = font.deriveFont(attributes);
        final JTextArea textArea = new JTextArea("The quick brown fox jumps over the lazy dog.");
        textArea.setFont(font);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        // tried either or both -- didn't help
        textArea.getDocument().putProperty("i18n", Boolean.TRUE.toString());
        textArea.putClientProperty("i18n", Boolean.TRUE.toString());
        JFrame frame = new JFrame();
        frame.add(new JScrollPane(textArea));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(850, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }Darryl
    edit Setting this property seems to remove the ability to render underlined and strikethrough attributes. Changed the code above to add these. When "i18n" is set, they are ignored.
    edit2 GlyphPainter2 also doesn't appear to support foreground/background colors and swap_colors. It's beginning to look like whoever wrote that class solved a single problem of cumulative integer math error but introduced several others. Or maybe just didn't reimplement the features that weren't inherited..
    Edited by: DarrylBurke on Sep 8, 2010 5:13 AM

  • Deselecting text in a text area as well as a input label?

    Hi there,
    Scenario - I have some text selected in a text area
    component. I get a callback from another program (external
    interface included) to remove the selection. How do i deselect the
    selected text and retain the text without selection? I have read on
    the .selected, .editable, .setSelected etc, but Im not getting it.
    This same prob exists with a normal text input type, it doesnt
    deselect there too.
    Can you please help me out? Is there something Im missing
    from the help doc?
    In short - How do we deselect text programatically in AS
    2.0?

    Hi Ned,
    The null param didnot work as expected, the selection goes
    and then again returns when I leave the mouse button. I tried
    adding a invisible botton obj outside the stage and then I gave
    it's instance to the param, this worked. Now this is hidden so I
    cannot see the tab effect on the stage since the button is outside.
    Thanks a lot for the answer Ned.

  • How can I copy and paste text into Word in Acrobat 9 Pro

    How can I copy and paste text into Word from Acrobat 9 Pro?

    You might find it easier to export the file to Word under File > Export > Word in Acrobat 9.

  • I'm in trouble with copy paste some text from Word to DW mx 2004

    I'am a new developer in webdesign. I'm doing my first site to
    a cliente. I'm in trouble with copy paste some text from Word to DW
    mx 2004. In the Edit / Preferences / General category i have the
    spelling dictionary in Portuguese (Brasilian). If I wrote the text
    in Portuguese directly from DW i can see the letters with ( ç
    ã é ... ) and in the browser testing ( IE 6.0.2 with sp2
    and FireFox 1.0.7 ), but with copy paste from the text in Word in
    Portuguese when i bring it to DW i can see the ( ç ã
    é ... ) in the beginnig but in the Browsers testing i can't,
    and then after a while i lose the ( ç ã o ...). Can
    anyone help me !?
    I need the work finish in next monday. Thanks a lot.

    Your line breaks will most likely be incorrect if you don't turn on the Japanese Composer.
    It is almost absolutely impossible to accomplish your goal without having a font - any font - installed on your system that has that glyph. However, if it's showing up in Word, than means that you must have that glyph installed, right? What font are you trying to use in InDesign? You might already know that Word will auto-substitute fonts when it encounters a missing glyph, so we really don't know what font is being used to render that one glyph. The whole sentence might be in MS Mincho but one glyph might be pulled from another font if MS Mincho doesn't have that glyph.
    That being said, you're going to break it if you don't know how to set Japanese type in ID. It's not something where you can just copy text out of email and paste into your English layout.

  • Problem pasting text from Word into Mail

    When I compose text in Word and paste it into Mail, paragraphs are separated by spaces that weren't in the original Word document and I have to do a lot of work to get rid of them. If I compose or paste the text in TextEdit and then copy the message into Mail, there's no problem. Is there a fix so I can just compose my messages in Word and then transfer them into Mail?

    Edwin Bernbaum wrote:
    It happens when I use past and match style as well. Any other ideas?
    Last month I started a message thread on what may be the same issue:
    http://discussions.apple.com/message.jspa?messageID=11083007
    There's a mention there of the Mail menu option Format -> Make Plain Text, which may help you.
    I filed a "bug report" with Apple (http://www.apple.com/feedback/macosx.html) about quirky spacing in Mail messages and the lack of any editing feature to control such spacing. Maybe you'd want to do the same.

  • Pasting text from word replaces Keynote styles

    I get documents that are styled in Word that I have to convert to Keynote. Even though my text boxes are styled in the Master Slides, when I copy and paste text from word it comes in with all of word's formatting and disregard's Keynote's styling for that text box. I tried to convert the word docs to rtf or just plain text, but the text just imports without Keynote's styling applied to it. It would be very tedious to have to style each text box as I bring it in to Keynote. Does anyone have any suggestions to make the workflow less painful?
    Thanks
    randini

    Welcome to the discussions, marc01.
    I don't have Omni Outliner to test with, but that does sound like something that's worth looking into. Send feedback to Omni at their site and to Apple with this link.
    http://www.apple.com/feedback/keynote.html

  • Pasting Text from Word to InDesign (need preserve selected formatting)

    When I import text from Word to Indesign I want to preserve the Italic and semi-bold but nothing else.
    The Indesign document has a template set up with ipsum text styled with semi-bold and normal text as well as a character style for the italic.
    When I paste the text into InDesign I want the ital and semi-bold to translate into the already styled text frame with no other formatting from Word.
    As there will be hundreds of text frames like this I want the ital etc to automatically translate. I also need to paste text over these templated text frames (see attached.
    Cheers,

    Use File > Place and check the import options instead of Copy/Paste.

  • I can't copy and paste text from Word to a Facebook Post since I've been using Firefox. Why am I getting the background code? Internet Explorer lets me copy text from Word to Facebook.

    I type my text in Word then open Facebook. I press Control-C to copy this text into my Facebook post and the result is that a lot of background code shows up.

    I would use the older version so you can continue working while troubleshooting continues in CC2014, if you haven't uninstalled it yet (and it didn't also lose the ability to copy/paste).
    Have you tried any of the usual suspects?
    Clear program cache and/or rename config folder: Deleting a corrupted cache file
    Restore Preferences: Restore preferences | Dreamweaver CS4, CS5, CS5.5, CS6

  • Editing TEXT in WORD file.

    Hi,
    Is it possible to EDIT a text file (word) from FORMS 10g. Let's say I want to FIND and REPLACE text in a word file. Is there any tools or JAVA code that can help me achieve this?
    Thanks in advance,
    Marc.

    The Adobe Reader for SymbianOS isn't a PDF editor. You'd need Acrobat
    for that, using the Text Touch-up Tool.
    Aandi Inston

  • Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some

    Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some headers and maps in this document are converted OK but the body text is garbled. I have tried converting to Docx, Doc and RTF with no success. I disabled OCR and it made no difference. What can I do please?
    Les

    Hi,
    Can you please provide me the file with which you are facing the issue.
    Thanks

  • AWT only canvas - styled text, images, word wrap and url posting.. how???

    Wassup people!
    Ive created a java chat client which uses the JTextPane to post messeges, emoticons and styled text. But the main problem here is that the majority of web browsers only support awt. Telling the users to download the latest jre with swing is long and most would rather go to another site, so i have reprogrammed the whole client in awt apart from the textpane. I now face the problem of creating a canvas that supports styled text, images, word wrap and url posting.
    I am only a beginner in java and the initial client was quite easy to do using swing, but to program an efficient canvas that supports this has proved to be quite challenging. would anyone beable to show me the best way of doing this? or refer me onto a library that already supports this? or is there even an awt version of the JTextPane somewhere which would save alot of time? any help would be most appreciated.
    Thanks

    I've seen a few APIs that are 100% pure java in 1.1 that implement a styled text area. They aren't free though and I'm pretty sure someone made some money off of the fact that java 1.1 didn't implement a styled text area.
    I understand the problem you are having. Before the days of swing styled text was something you wished you had. Just so you know, there is no easy way of doing this. You could always paint it yourself with a canvas in a scroll pane but then you get to the point where, unless you did some serious mouse handling, highlighting text becomes very difficult.

  • [Help] Get Text Between words!

    Hi,
    I wanna to Get Text Between words,
    I'm tring to something like this , can anyone help please ?
    <?php
    $data = "<a target='_blank' href='http://www.mysite'>Engineering</a><des>Description</des>
             <a target='_blank' href='http://www.mysite'>Accountant</a><des>Description</des>";
    // Define Pattern
    $linkS = "href='";    $linkE = "'>";
    $titleS = "<link>";    $titleE = "</link>";
    $desS = "<des>'";    $desE = "</des>";
    //Get Text in the between
    preg_match("/{$linkS}([^`]*?){$linkE}/", $data, $temp);
    //First Group
    $link1 = $temp['1'];
    $title1 = $temp['1'];
    $des1 = $temp['1'];
    //Second Group
    $link2 = $temp['2'];
    $title2 = $temp['2'];
    $des2 = $temp['2'];
    //Third Group
    //and so on
    $Link1= strip_tags($link1);
    $Link2= strip_tags($link2);
    echo $Link1;
    echo $Link2;
    ?>

    Hi,
    Check the following link:
    http://www.sap-img.com/sapscripts/sample-sapscripts-label-printing-program.htm
    you will get one sample program of sample label pring program.
    hope it help you.
    Regards,
    Bhaskar

  • Cursor won't highlight text in word

    All of a sudden the cursor will not select text in ms word.  I can double click to select groups of words but I can't click and drag the cursor over words to select them.   There was no change in software- just out of the blue.
    thanks for any advice

    I have had the same problem for more than a year. Mostly with text I've copied from the Web. I've realized that I'm actually selecting the text by clicking and dragging the cursor over the text in Word, but it doesn't highlight what I've selected. I just have to trust that I've done it right and then copy/paste or whatever. If anybody has a fix for this, I'd love to hear it.

  • Copy text from Word '03 into RH9

    I need to copy text from Word into RH in a way that does not bring in the Word codes.  I can obviously copy the text into notepad and then into RH, but I am wondering if there is a way to do it that would be similar to the "Paste Special / Unformatted Text" command in Word? 
    We cannot have the word codes in RH because we translate our user manuals and then use the translated UM text to gain discounts when we translated the html help files.  These codes throw off the matching and cause us to gain hardly any discounts.  Even simple formatting, like a bolded word puts in the word codes into the html code. I made the mistake of thinking if I unbold the word in RH then everything is fine, but little did I know the Word code was still in the HTML. 
    I appreciate your help.
    Also, I am open to suggestions on a better way to get my Word text into RH to be help.  I've started looking into Importing and Linking, but haven't figured out if they would be all that beneficial to us.

    Hi there
    Try the link below:
    http://www.grainge.org/pages/authoring/importing/about_importing_linking.htm
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

Maybe you are looking for

  • Problem with Ping followers

    I have a problem with iTunes Ping that I wasn't able to solve no matter how hard I tried. Basically I deactivated my Ping account and later reactivated it, just to find out that I now cannot be followed again by those who were following me before and

  • Coercion problem when using Shared Variable

    I have a curious coercion problem when using Shared Variables.  I want to share the state of a State Machine, which is an enum saved as a control (typedef) called TYPE State (see attached).  I create a shared variable called State and define it as a

  • Decimal place problem in smartforms..

    Hi All, I my smart forms i am displaying a quantity filed, but itz displaying with 3 decimal places. But i need to hide the decimal places. I try to use formating option &symbol(.N)&  but itz giving error while calling the smart forms. Plz help me...

  • My files are missing

    my files are completely missing from the old adobe version please restore them, thank you, herman

  • Where to find "Tools" on my Skype page?

    How do I find tools on my Skype page