Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Grammar Changes within Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reitanos - 29 May 2008 20:59 GMT
Hi,

I'm doing a change case (Title) with a selection in a macro and would
like to let Word make any grammar suggestions within the selected
text. Is there a command that will allow this?
Also, is there a way to count how many suggestions there are within
the selection?

Thanks in advance for your assistance.
StevenM - 29 May 2008 22:01 GMT
To: Reitanos,

'
' If Spelling & Grammar dialog box pops up,
' press cancel
'
Sub TestGrammar()
   Dim newDoc As Document
   Dim oRange As Range
   Dim gramErr As Variant
   
   Set newDoc = Documents.Add
   Set oRange = newDoc.Range
   oRange.Text = "Once upon a time, there was a boy. Boy throw apples
oranges fruit. And then he ran away."
   If newDoc.GrammarChecked = False Then
       newDoc.CheckGrammar
   End If
   
   Set gramErr = oRange.GrammaticalErrors
   MsgBox "Number of Errors: " & gramErr.Count
   Set oRange = oRange.GrammaticalErrors(1)
   MsgBox "Error: " & oRange.Text
   
End Sub

Steven Craig Miller

> Hi,
>
[quoted text clipped - 5 lines]
>
> Thanks in advance for your assistance.
Reitanos - 29 May 2008 22:48 GMT
Thanks!

On May 29, 5:01 pm, StevenM <stevencraigmiller(at)comcast(dot)net>
wrote:
> To: Reitanos,
>
[quoted text clipped - 33 lines]
>
> > Thanks in advance for your assistance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.