TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
chetan Allipur
NA
541
167.8k
Convert and give me VBA to c#
Jul 3 2017 2:40 AM
Here is my VBA code
sTemp = sGetDocVar("ParaNo1Text")
For i = 0 To cbxNumbPara1.ListCount - 1
If InStr(1, UCase(cbxNumbPara1.List(i)), UCase(sTemp)) = 1 Then
cbxNumbPara1.ListIndex = i
lblNumbPara1 = FirstWord(cbxNumbPara1.List(i))
End If
Next
If cbxNumbPara1.ListIndex < 0 Then cbxNumbPara1.ListIndex = 0
If lblNumbPara1 = "" Then lblNumbPara1 = "Not set"
Converted Code
sTemp = sGetDocVar("ParaNo1Text");
for (i = 0; i <= cbxNumbPara1.ListCount - 1; i++) {
if (Strings.InStr(1, Strings.UCase(cbxNumbPara1.List(i)), Strings.UCase(sTemp)) == 1) {
cbxNumbPara1.ListIndex = i;
lblNumbPara1 = FirstWord(cbxNumbPara1.List(i));
}
}
if (cbxNumbPara1.ListIndex < 0)
cbxNumbPara1.ListIndex = 0;
if (string.IsNullOrEmpty(lblNumbPara1))
lblNumbPara1 = "Not set";
I am getting errors
1) Strings.InStr.
2) Strings.UCase
3) cbxNumbPara1.List(i)
Please anyone correct and send me the code
Reply
Answers (
2
)
invoking just-in-time (JIT) debugging instead of this dialo
Table Header and Table Text using VSTO word.