Reading the word under the cursor within MS Word

I saw a very interesting article yesterday.
Reading the word under the cursor
And confirmed it today. Yes, it works fine with me.
But, it works only with Notepad.
It, even, does not work with Visual Studio itself.
(Of course not with Notepad++ too.)
Now. Simple asking.
Can you show me how to do it within MS Word using VSTO ?
I am with Word 2010.
Regards

Hi Using_Word_Everydai,
>>You do not need to consider any kind of method within VBA (as your explanations) or do not calculate the location of caret (as your explanations). <<
I would explian more detail about VBA and VSTO. Based on my understanding, we can automate Word application using Word object model in VBA and Word PIAs in VSTO solution. And there is tiny difference on the API, that the reaseon I provide a VBA demo.
>>Reading the word under the cursor within MS Word<<
Here is the code that for your reference to achieve the goal in VSTO solution(application level add-in):
MessageBox.Show(Globals.ThisAddIn.Application.Selection.Range.Words[1].Text);
>>
Now, I have three steps.
1. Move to there.
2. Press "Alt_key"
3. Click Mouse button.<<
I am still not able to under the secnario you are handling exactly. Based on my understanding, if we want to grab the wrod in the document, we need to move the mouse click the word in the document then we can call the code above to grabe the Word under the
cursor.
For example, we can custom the ribbon of Word and add a custom button. Then click the word we need to grab then click the custom button to get the word.
If I misunderstood, please feel free to let me know.
Regards & Fei
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to Grab a word under the cursor within MS Word using VSTO ?

    MS Word can grab a word under the cursor.
    You can find this function at "Review tab > Translation group > Mini translator".
    If you hoover mouse over a word, it automatically grabs the word under cursor.
    So, this is inside ONLY function ? Is there any way to use the same function user like me ?
    Show me the way please.
    (I do not need to translate it. I just need to grab it easily and quickly.)
    Regards

    Hi Guys,
    Let's clarify your requirements. Per my understanding, you want to get the related word or words under the cursor using VSTO.
    I assume I understand your requirement corrrectly. Per my experiences, I would suggest you try OCR. I remembered I post the same idea in your another thread.
    Generally, there are two steps.
    1. Get the screenshot under the cursor. Note: The screenshot range isn't large.
    2. Get the word from the screenshot. You will use OCR.
    That's my solution.
    But it's very complex. not very easy to achieve. It needs some knowleges about arithmetic.
    Hope this can help you.
    Regards,
    The future belongs to those who believe in the beauty of their dreams.

  • Cursor tips : refresh data fetched by the cursor within run time,discussion

    Hello there,
    May be what I am asking about is kind of weird, but here is the Q:
    let us assume that I have cursor defined as follows:
    cursor emp_cursor is
            select EMPNO, ENAME, deptno
            from emp
            where deptno = 10 ;
    emp_rec  emp_cursor%rowtype;  then inside the loop through the data fetched by this cursor, I need to update some records, which might match the criteria of the cursor, by trying the following code segment:
    open emp_cursor;
          loop
            fetch emp_cursor into emp_rec;
            exit when emp_cursor%notfound;
            "PROCESS THE RECORD'S DATA "
            DBMS_OUTPUT.Put_Line('count of the records: ' || emp_cursor%rowcount);
            DBMS_OUTPUT.Put_Line('deptno: ' || emp_rec.deptno);
            DBMS_OUTPUT.Put_Line('emp no: ' || emp_rec.empno);
            update emp
            set deptno = 10
            where empno= 7566;
            commit;
            DBMS_OUTPUT.Put_Line('after the update');
          end loop;
          close emp_cursor; but the run never shows the record of employee 7566 as one record of the cursor, may be this is the execution plan of the cursor,
    but for the mentioned case, need to re-enter those updated records to the cursor data, to be processed, ( consider that the update statement is conditioned so that not executed always)
    any hints or suggestion
    Best Regards,

    John Spencer wrote:
    Justin Cave wrote:
    Not possible. You'd have to close and re-open the cursor in order to pick up any changes made to the data after the cursor was opened.Then close and re-open it to get any changes made while processing the second iteration, then close and re-open it to get any changes made while processing the third iteration ad infinitum :-)I'm not claiming there are no downsides to the process :-)
    On a serious note, though, the requirement itself is exceedingly odd. You most likely need to rethink your solution so that you remove this requirement. Otherwise, you're likely going to end up querying the same set of rows many, many, many times.
    Justin

  • How can I write and read the LPT within JAVA?

    Hello!
    I'm new to JAVA.
    I made a simple JAVA application with few buttons and labels with NetBeans.
    I add ActionListener to button but don't know to write the handling code that should to write a byt to the DATA register in the LPT port of the PC box.
    From where can I get the code for this, maybe within JDK documentation?
    Any advices will be appreciated!
    Regards, csPaul

    I have ever programmed an LPT data sender using VB.net and inpout32.dll(will be very easy to search using google). for Java, try this:
    http://www.geocities.com/Juanga69/parport/
    I've just download the sample also, wanna try to...
    And some people say that JNI allow us to embedd C++ code within our Java program.. I don't know about this yet...

  • Positioning the cursor on a control in batch input

    Campus Management, transaction PIQ_ACCATLG
    In order to create a business event or event type you have to first select the the Module object from the tree list displayed on the screen.  However, the fields in the tree list do not get recorded using SHDB and a BDC_CURSOR record is not generated.  Also, pressing F1 on these fields does do anything.
    Is it possible to place the cursor within the tree list in batch input?  If so, how is it done?

    You should be posting this question in the ABAP forum.
    Message was edited by: Mark Finnern
    Moved the thread.

  • Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers and firefox

    Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers, firefox, and when trying to move any file from the downloads folder.
    This is a serious pain.
    Please help.
    WB

    Yes, all I can tell you is that Finder does not have that function in ML. Your system is "working as expected".
    You can file feedback here.

  • Mail under Mavericks_keep failing the right place to put the cursor to rewrite a word

    Mail under Mavericks_keep failing the right place to put the cursor to rewrite a word.
    When I´m writing a mail, if I see an error and want to rewrite a word or a sentence, it´s almost impossible to put the cursor at the right place to rewrite what I need. Most of the times I´ve to erase entire sentences and write everything again.
    Any suggestion for this new problem under Mavericks? Please.
    Thank you.

    https://discussions.apple.com/message/23650743#23650743
    This solved my problem.
    Thanks.

  • With clause within the cursor ???

    Hello gurus,
    Can we have a with clause within the cursor ???
    something like this ..
    cursor test_cur is
    WITH unpivoted_data     AS
         SELECT DISTINCT
    f.cust_id
              f.office_cd
              f.type_cd
         FROM      refoff      ro,
              cutomer     p,
              office     f
         WHERE     f.cust_id     = p.cust_id
         AND     f.office_cd      = ro.office_cd
         AND      f.type_cd      IN ('ACCT', 'pay')
    SELECT     cust_id
    ,     MAX (CASE WHEN type_cd = 'ACCT' THEN office_id END)     AS acct_office_id
    ,     MAX (CASE WHEN type_cd = 'pay' THEN office_id END)     AS pay_office_id
    FROM     unpivoted_data
    GROUP BY cust_id
    test_cur_rec test_cur% rowtype;
    Begin
    for test_cur_rec in test_cur
    loop
    insert into test1 (.....) values (.......);
    end loop;
    end;
    One more quick question .... How do u guys past in the posting ??? Like somesought of a box .....I have seen lot senior gurus when they are replying, they post the code in some sought of a box ....that makes very easy to understand and take look at the code in the posting....???
    Thank you so much!!!

    Hi,
    user642297 wrote:
    Hello gurus,
    Can we have a with clause within the cursor ???Sure, but don't take my word for it. Try it and see!
    If you get an error, post the error message.
    If you get unexpected results, explain.
    Whenever you have a problem, post your full Oracle version number.
    One more quick question .... How do u guys past in the posting ??? Like somesought of a box .....I have seen lot senior gurus when they are replying, they post the code in some sought of a box ....that makes very easy to understand and take look at the code in the posting....??? Type these 6 characters:
    (all small letters, inside curly brackets) before and after formatted sections.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words.

    My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words and looks them up via dictionary. I currently have a wireless mouse connected and I am still having the same problems.
    I fee like I may have a virus or my laptop is perhaps being accessed remotely. All of the sharing options are unchecked.
    HELP PLEASE
    Very worried!!

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

  • How to get highest number of open cursors within the current calendar day

    Hi all ,
    i need to know how to get the highest number of open cursors within the current calendar day.
    Thanks ,

    823030 wrote:
    the issue is my customer is getting the error ORA-01000: maximum open cursors exceeded and we need an sql statment that gets the following values :
    -highest number of open cursors experienced in the current calendar day.
    -current open cursors
    -and maximum open cursorsThis error is rare. It happens when
    a) the value of the open cursor parameter is set extremly low (default is something like 1000). Low would be something like 10.
    b) <strike>you have many concurrent users(=sessions) and </strike>the application does not use bind values
    In this case each select will open a new cursor, instead of reusing it.
    c) you have a select that opens a cursor for each line. This can happen with a statement where you have the CURSOR keyword somewhere in the select or where clause. Those cursors will be closed when the select is finished. But during the run time of the select, all cursors stay open.
    To track the number of "open cursors" during the day you would need to implement some monitoring. Maybe based on the view that was already mentioned.
    Edited by: Sven W. on May 16, 2011 2:30 PM - since the parameter is on session level, other open cursors should not influence it much.

  • Updated to 10.8.4 2mnths ago nothing but problems /PS6,Safari Word,MAil so ihad Loin reinstalled 2wks ago and know the smae problems no ability to t]sue type in safari mail PS6 word and the cursor start freezing in PS6 after 1 hr of use can anybody figure

    Updated to Mountian lion 2 mnths ago had nothing but problems,I had no problems with lion, so i had a tech reinstall lion, Now agian I am  having problems with the cursor freezing and disappearing in photoshop and not being able to use type in word, safari, mail, photoshop6 ,lightroom4 any suggestions as I don't believe apple is going to doing anything,thy've stuck thier head in the sand and ignored it.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, or by a peripheral device.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including Wi-Fi on certain iMacs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • When mousing over text, the cursor flickers constantly (with each letter passed) from arrow to i-beam and back.  The problem occurs in both MS Word and Pages.  Any idea of how to resolve this annoying problem is appreciated.  System: 10.10.1

    When mousing over text, the cursor flickers constantly (with every letter passed) from arrow to i-beam and back.  The problem occurs in both MS Word 2011 and Pages.  Any idea of how to solve this annoying problem will be much appreciated.  System 10.10.1 on a MacPro (Late 2013)

    The mouse is controlled by the OS so don't guess any app other than a mouse driver or OS X itself would be able to cause this sort of flicker issue.
    Have you seen the following and is it what you are seeing? Maybe you could make a movie (Quicktime is great for this this to make a screen recording) - but not sure how to attach a movie to these discussions as mine is grayed out and can't be selected (to the right of the insert image). Here is the what I found for a search of "mouse cursor flickers os x yosemite"
         https://www.youtube.com/watch?v=ZNQ0D84DdF4
    What kind of mouse are you using? Is the mouse driver up to date if it's a third party mouse?

  • The cursor jumps to the address bar while typing within a web screen. How do I fix this?

    I will be typing within a page and the cursor will jump to the address bar, sometimes after typing just 1 letter. I will go back to where I am typing and it jumps again, repeatedly! This happened before and I don't remember how we resolved the issue. I just fixed an issue wit Firefox being slow to start by resetting it (like they recommend) and this cursor problem started right away, so I assume this is related to Firefox.

    Hello truthwins, try '''disabling graphics hardware acceleration'''. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    #Open Firefox ''Options'' window (''Preferences'' on Mac or Linux) as follows:
    #* In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]] and select ''Options'' for Windows or ''Preferences'' on Mac or Linux.
    #* In Firefox 28.0 and previous versions, click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    #In the Firefox Options (or Preferences) window, click the ''Advanced'' tab, then select ''General''.
    #In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    #Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Thank you.

  • How can I create cursors within the cursor?

    How can I create cursors within the cursor?
    Table1 2001 - 2007 data
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Seq_Num
    Value1
    Value2
    Table2_Historical (doesn't have Num as a field) 1990 - 2000 data
    Account_no
    Account_eff_dt
    No_account_holder
    Seq_Num
    Value1
    Value2
    Table3_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    My result table should be:
    Table_result_06
    Account_no
    Account_eff_dt
    No_account_holder
    Num
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    I have to get data from Table1 and Table2_Historical. If one account was open in 1998 and is still effective, the minimum value of that account is in the Table2_Historical.
    Let's say I open a cursor:
    cursor_first is
    select * from table3_06;
    open csr_first
    loop
    fetch cursor_first into
    v_Account_no
    v_Account_eff_dt
    v_No_account_holder
    v_Num
    EXIT WHEN csr_first%NOTFOUND;
    How can I open a second cursor from here that will get the Seq_Num from Table1
    csr_second
    select Seq_Num from Table1 where
    v_Account_no = Account_no
    v_Account_eff_dt <= Account_eff_dt
    v_No_account_holder=No_account_holder
    v_Num = Num
    How does it works???
    Thanks a lot

    Thanks so much for replying back. Here is what I am trying to do.
    I have to create a table for each year 2002, 2003, 2004, 2005, 2006 that has all the account numbers that are active each year plus some other characteristics.
    Let’s say I will create Table_result_06. This table will have the following fields. The account number, account effective date, Number of the account holder and the field Num (The primary key is a combination of all 4 fields), the beginning look of value 1 in 2006, the last look of value 1 in 2006.
    Table_result_06
    Account_no key
    Account_eff_dt key
    No_account_holder key
    Num key
    Value1_min (the minimum value for the minimum of record_sequence)
    Value2_max (the maximum value for the maximum of record_sequence)
    All the active account numbers with the Account_eff_dt, No_account_holder and Num are in the Table3. As such I can build a query that connects Table3 with table Table1 on all 4 fileds, Account_no, Account_eff_dt, No_account_holder, Num and find the Value1_min for the min of req_sequence in 2006 and Value1_max for the max of req_sequence in 2006. Here my problem starts.
    Table 1 doesn’t have a new entry if nothing has changed in the account. So if this account was open in 1993 and nothing has changed I don’t have an entry in 2006 but this doesn’t mean that this account doesn’t exist in 2006. So to find the minimum value I have to go back in 1993 and find the max and min for that year and that will be max and min in 2006 as well.
    As such I have to go to Table_2 historical and search for min and max. But this table doesn’t have the field NUM and if I match only on the Account_no, Account_eff_dt and No_account_holder I don’t get a unique record.
    So how can I connect all three tables, Table 1 for max and min, if it doesn’t find anything will go to table 2 find the two values and populate Table_result_06.
    Thanks so much again for your hep,

  • Query within the Cursor loop is very slow

    Hi ,
    I have a stored procedure which has Select/Insert operation which is looped within the cursor. The Select uses variables from the cursor, and inserts the data into the table.
    My problem is the peformance. The stored procedure executes in 2 mins if I hard code the where clause values in the Select. Instead if I use the variables obtained from the cursor, the query takes so long (more than 20 mins) to insert the same no of records into the table.
    Below is the snippet of my code
    create procedure sample is
    declare
    v_acct_month number(2);
    v_sp_name varchar2(30);
    cursor v_cur is Select distinct Acct_Month,salesperson_name from period;
    begin
    open v_cur;
    loop
    fetch v_cur into v_acct_month, v_sp_name;
    exit when v_cur%notfound;
    Insert into T1
    Select * from T2,T3.. Where T2.month=v_acct_month,t3.sp_name=v_sp_name;
    end loop;
    End;
    The query is not using the optimizer when the variables are used.The optimizer is used when I hard code the values in the select.
    Please give me suggestions to make this query faster..
    Thanks,
    Arun
    Edited by: [email protected] on Mar 28, 2009 10:18 AM

    Hi,
    Whenever you write code, format it to show the scope of BEGIN, LOOP, IF statements, and so on.
    Type these 6 characters
    &#123;code&#125;
    (small letters only, inside curly brackets) before and after the formatted code, to preserve spacing on this site.
    You've discovered why the tecnique you're using is called "slow-by-slow" processing.
    You don't need a cursor. You may not even need PL/SQL.
    Just write an INSERT statement that reference the table from the cursor and the tables from your current INSERT statement.
    Here's one way:
    INSERT
    INTO     t1 (columns)
    SELECT         columns
    FROM     t2
    ,     t3
    WHERE     ...
    AND     (t2.month, t3.sp_name)     IN (
                              SELECT DISTINCT
                                   acct_month
                           ,        salesperson_name
                           FROM        period
                           );Depending on the details of your case, there may be a better way, such as a 3-way join.

Maybe you are looking for

  • HT5625 How can I combine an old Apple id to the new one and update my Apps. Can this be done?

    I used an older Apple id for a few years and paid for Apps. Now, I don't use this anymore, but some of my paid Apps need updating. I can't remember my old password, and Apple support doesnt' seem to have an answer. So, I can't update my older Apps. T

  • System Image Utility

    Hi All, When I try and open system image utility I get an error that just reads that I have no sources when in fact I do. I have a 15GB DMG Image that I would like to install over the network for our computer labs that I have placed in the NetBootSP0

  • Seagate or Toshiba external harddrive?

    I have a macbook pro that runs on mac os x 10.7.5. I recently bought a Seagate back up plus external harddrive thinking that it was a portable one as oppossed to the Toshiba Canvio Desktop. However, I just took it out of the box and turns out it also

  • Low quality pdf generated

    i want to create pdf from uiview but the quality of generated pdf is poor.How can i create high quality pdf.

  • Info record Text download and upload

    Hi, Can you guys tell me how to download the info record text from one plant (info record text and purchase order text in inforec) and then i need upload the same text in diff plant. Is there a std way of doing this? (i don't think i have seen it) Ca