In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces VB.NET word how to check the text, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
VB.NET word looks up the text code:
Public Class ThisDocument Private MyDocMenu As Office.CommandBarButton Private missing = System.Reflection.Missing.Value 'add menu group Private Sub ThisDocument_Startup (ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup Dim MyCommandBarPopup As Office.CommandBarPopup = Nothing Dim MyCommandBarMenu As Office.CommandBar = CType (_ Application.CommandBars.ActiveMenuBar, Office.CommandBar) Dim MyControlsCount As Integer = MyCommandBarMenu.Controls.Count MyCommandBarPopup = CType (MyCommandBarMenu.Controls.Add (_ Office.MsoControlType.msoControlPopup, missing, missing, _ MyControlsCount, True) in the ribbon Office.CommandBarPopup) If (MyCommandBarPopup IsNot Nothing) Then MyCommandBarPopup.Caption = "file management" MyDocMenu = CType (MyCommandBarPopup.Controls.Add (_ Office.MsoControlType.msoControlButton, missing, _ missing, missing, True), Office.CommandBarButton) MyDocMenu.Caption = "find text" AddHandler MyDocMenu.Click, AddressOf MyDocMenuCommand_Click End If End Sub Private Sub ThisDocument_Shutdown (ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown End Sub 'find text Private Sub MyDocMenuCommand_Click (ByVal Ctrl As Microsoft.Office.Core.CommandBarButton ByRef CancelDefault As Boolean) Dim MyFind As String = "" Dim MyFindForm As New Form1 () MyFindForm.ShowDialog () MyFind = MyFindForm.textBox1.Text If (MyFind.Length < 0) Then Return End If Dim MyCount As Integer = 0 Dim MyDocument As Word.Document = Me.Application.ActiveDocument Dim MyRange As Word.Range = MyDocument.Content MyRange.Find.ClearFormatting () MyRange.Find.Forward = True MyRange.Find.Text = MyFind MyRange.Find.Execute (missing, _ missing, _ missing, missing Missing, missing, missing) While (MyRange.Find.Found) MyRange.Bold = 1 MyCountMyCount = MyCount + 1 MyRange.Find.Execute (missing, _ missing, _ missing, missing) End While MessageBox.Show (MyFind + "Total found: + MyCount.ToString () +"! ", _" 51cto Information Tip ", MessageBoxButtons.OK MessageBoxIcon.Information) End Sub End Class, thank you for reading this article carefully. I hope the article "how to look up the text in VB.NET word" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.