Home > Software engineering >  Check the schedule of the code
Check the schedule of the code

Time:11-20

Keyword, then the program implements the search function, from the edit good document to find the corresponding content then displayed

CodePudding user response:

Check a file or multiple files?
What's the schedule format? Doc? XLS? TXT?
What kind of show? Open the word/excel/notepad application? The pop-up dialog?

CodePudding user response:

In a word, the remaining on the future of science and technology thoughts and the heart communication,

CodePudding user response:

TXT file format, is to use VB program to do, want to use msgbox play out

CodePudding user response:

reference weixin_45099090 reply: 3/f
TXT file format, is to use VB program to do, want to use msgbox pop up

What is the result of the pop-up? A good example?

CodePudding user response:

Also TXT data, for example;

CodePudding user response:

reference 4 floor milaoshu1020 response:
Quote: reference weixin_45099090 reply: 3/f

TXT file format, is to use VB program to do, want to use msgbox pop up

What is the result of the pop-up? A good example?

Lose Monday in the search box, for example, bring up a small rectangular box, search to Monday's schedule from a file, then displayed in a small box

CodePudding user response:

Every day the schedule content in a TXT file, respectively

CodePudding user response:

This toothpaste squeezed...

CodePudding user response:

Write well, code is as follows:
 
Option Explicit

Private fso As New FileSystemObject

Private Sub Command1_Click ()
If Combo1. Text="" Then
MsgBox "search content is empty!" , vbCritical
The Exit Sub
End the If

Dim strPath As String
StrPath=fso. BuildPath (App) Path, Combo1. Text & amp; ". TXT ")

If Not fso. FileExists (strPath) Then
MsgBox "file not found!" , vbCritical
The Exit Sub
End the If

Dim objStream As TextStream
The Set objStream=fso. OpenTextFile (strPath, ForReading, False)

Dim strContent As String
StrContent=objStream. ReadAll

ObjStream. Close

MsgBox strContent
End Sub

Run the example:

Download address:
Link: https://pan.baidu.com/s/1jB1vUIstev785KNzrGC41g
The extracted code: oq0y

CodePudding user response:

Why the second line of code displayed on the computer has a problem, the question is: user-defined types undefined, be urgent!!

CodePudding user response:

Will add references? Menu has a reference, adding Microsoft Scripting Runtime reference;

CodePudding user response:

I have uploaded to the baidu network backup and sharing, you can download a try.

CodePudding user response:

Uh uh uh huh! Thank you!!! You are so great!
  • Related