Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2011, 06:22 PM
MShroff MShroff is offline Right click in Macro Windows 7 Right click in Macro Office 2007
Novice
Right click in Macro
 
Join Date: Oct 2010
Posts: 9
MShroff is on a distinguished road
Default Right click in Macro

When making a macro i want to right click on the word - how can I do that? I am trying to record a macro where I right click on a misspelled word (eg bigboy) and then select the first option where the word is corrected to big boy. Word will not let me right click when recording. How can I get around this?

Thank you
M Shroff
Reply With Quote
  #2  
Old 04-05-2011, 07:01 PM
macropod's Avatar
macropod macropod is online now Right click in Macro Windows 7 32bit Right click in Macro Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi M Schroff,

You could simulate the right-click with:
SendKeys ("+{F10}")
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-05-2011, 07:26 PM
MShroff MShroff is offline Right click in Macro Windows 7 Right click in Macro Office 2007
Novice
Right click in Macro
 
Join Date: Oct 2010
Posts: 9
MShroff is on a distinguished road
Default

My apologies, I dont get it. I am not very WORD savvy!

MShroff
Reply With Quote
  #4  
Old 04-05-2011, 08:23 PM
macropod's Avatar
macropod macropod is online now Right click in Macro Windows 7 32bit Right click in Macro Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi M Schroff,

I don't really understand why you want a sub with the right-click approach, when you could use a sub like:
Code:
Sub Demo()
Selection.Range.CheckSpelling
End Sub
The Sendkeys code is what you'd add to a sub to simulate the right-click after something has been selected (either by the user before running the sub or by the sub itself). For example:
Code:
Sub Demo()
Dim StrWrd As Range
For Each StrWrd In ActiveDocument.Paragraphs(1).Range.Words
  With StrWrd
    If .SpellingErrors.Count > 0 Then
      .Select
      SendKeys "+{F10}", True
      Exit Sub
    End If
  End With
Next
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-05-2011, 09:00 PM
MShroff MShroff is offline Right click in Macro Windows 7 Right click in Macro Office 2007
Novice
Right click in Macro
 
Join Date: Oct 2010
Posts: 9
MShroff is on a distinguished road
Default

Thank you for your help.
M Shroff
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Right click in Macro Alter right click menu? markg2 Office 1 01-10-2011 08:10 AM
Click -to run headache lazarus34 Office 0 09-14-2010 08:42 AM
Right click in Macro Can't click on links in email MrJP Outlook 1 08-28-2010 06:39 PM
What is this right-click sub-menu called? wornways Word 3 08-13-2010 09:17 PM
Right click in Macro My Subforms jump when I click the tab jbryanh Office 1 10-13-2005 07:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft