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.
Bryian TanPosted Jun 6, 2017, 9:51 AM