6
Reply

Please convert and give me VBA to C# code.

chetan Allipur

chetan Allipur

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