chetan Allipur

chetan Allipur

  • NA
  • 541
  • 167.5k

Please convert and give me VBA to C# code.

Jun 22 2017 4:41 AM
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

Answers (6)