1
Answer

How to get the value by passing the string to method.

How to get the value by passing the string to method using word VSTO.
 
I have VBA Code here
 
Dim sTemp As String
sTemp = sGetDocVar("CTDPrefix")
 
method here
 
Function sGetDocVar(ByVal sVName As String) As String
On Error GoTo sGetDocVar_ERROR
sGetDocVar = ActiveDocument.Variables(sVName).Value
Exit Function
sGetDocVar_ERROR:
Select Case Err.Number
Case 5825 'Variable does not exist
sGetDocVar = vbNullString
Case Else
Const sProcedure As String = "sGetDocVar"
End Select
End Function
 
Please tell me in c# using word VSTO. Please anybody help me its urgent. 
 
 
 
Answers (1)