Please convert and give me VBA to C#
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


Vivek KumarRank #272 · 9.3K reputationPosted Jun 22, 2017, 12:50 AM EDT
chetan AllipurRank #2,527 · 554 reputationPosted Jun 22, 2017, 12:51 AM EDT
Vivek KumarRank #272 · 9.3K reputationPosted Jun 22, 2017, 1:22 AM EDT
Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 22, 2017, 8:33 AM EDT