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
Brosborough
NA
1
0
Manipulating Word documents
Dec 22 2004 11:45 PM
I'm running into a problem with opening and then trying to close Word documents in VB.net. This code worked ok in VB6 but getting an error when trying to close the document once the word search is complete: For j% = 0 To UBound(strFileBuff) LstResults.ForeColor = Color.Red ProgressBar1.Value = ProgressBar1.Value + 1 strPath = strFileBuff(j%) commandSearch.Enabled = False Me.Text = "Searching " & strPath wd.Documents.Open(strPath) wd.ActiveDocument.Activate() myRange = wd.ActiveDocument.Content myRange.Find.Execute(FindText:=cmbWord.Text, _ Forward:=True) While myRange.Find.Found = True i% = i% + 1 myRange.Find.Execute(FindText:=cmbWord.Text) End While If i% > 0 Then LstResults.Items.Add(strPath) i% = 0 wd.ActiveDocument.Close() End If Next j% THE ERROR IS WITH WD.ACTIVEDOCUMENT.CLOSE() - I GET THE MESSAGE - "Close is ambiguous across inherited interfaces 'Word._Document' and 'Word.Document Events_Event'. Same thing if I try to use wd.close. ANY SUGGESTIONS?
Reply
Answers (
0
)
Setting the font for different lines in a richTextBox
Accessing the LPT