Class Research (Word VBA)

Provides access to the research service feature of Microsoft Word. To use a Research class variable it first needs to be instantiated, for example


Dim rsr as Research
Set rsr = ActiveDocument.Research

FavoriteService

Returns or sets a String that specifies the favorite research service.

The String that is set or returned for this property specifies the GUID of the favorite research service. Setting this property has the same effect as choosing a favorite research service through the Research Options dialog in Word.


Dim objResearch As Research 
 
Sub MyFunction() 
 
Set objResearch = Research 
 
'Set the favorite service 
objResearch.FavoriteService = "FEF89077-4F4D-4803-A8BF-228083F70EAA" 
 
End Sub

IsResearchService

Indicates whether the GUID specified in the ServiceID parameter corresponds to a currently configured service.

IsResearchService (ServiceID)

ServiceID: Specifies a GUID that identifies the research service.


Dim strServiceID As String: strServiceID =  
Dim booIsResearchService As Boolean
booIsResearchService = ActiveDocument.Research.IsResearchService(ServiceID:=strServiceID)

Query

Specifies a research query.

Query (ServiceID, QueryString, QueryLanguage, UseSelection, LaunchQuery)


Dim strServiceID As String: strServiceID =  
Dim varQuery As Variant
varQuery = ActiveDocument.Research.Query(ServiceID:=strServiceID)

Arguments

The following argument is required

ServiceID (String) - Specifies a GUID that identifies the research service.

Optional arguments

The following arguments are optional

QueryString (String) - Specifies the query string.

QueryLanguage (WdLanguageID) - Specifies the query language of the query string.

Here you can find possible values for WdLanguageID

UseSelection (Boolean) - True to use the current selection as the query string. This overrides the QueryString parameter if set. Default value is False.

LaunchQuery (Boolean) - True launches the query. False displays the Research task pane scoped to search the specified research service.

SetLanguagePair

Sets the languages for the translation service.

SetLanguagePair (LanguageFrom, LanguageTo)


ActiveDocument.Research.SetLanguagePair LanguageFrom:=wdAfrikaans, LanguageTo:=wdAfrikaans

Arguments

The following arguments are required:

LanguageFrom (WdLanguageID) - Specifies the language to translate from.

Here you can find possible values for WdLanguageID

LanguageTo (WdLanguageID) - Specifies the language to translate to.

Here you can find possible values for WdLanguageID