ไปยังเนื้อหาหลัก

วิธีค้นหาและแทนที่หัวข้อการนัดหมายในปฏิทิน Outlook

ค้นหาและแทนที่หัวเรื่องการนัดหมายในปฏิทิน Outlook จะมีประโยชน์เมื่อคุณพบว่าบางวิชาจำเป็นต้องแทนที่ด้วยข้อความเดียวกันเป็นจำนวนมาก หรือแทนที่คำว่าคัดลอกในช่องหัวเรื่องหลังจากนำเข้าข้อมูลใน Outlook บทความนี้ให้รหัส VBA เพื่อค้นหาและแทนที่หัวข้อการนัดหมายหลายรายการ โปรดเรียกดูรายละเอียดเพิ่มเติม

ค้นหาและแทนที่หัวข้อการนัดหมายด้วยรหัส VBA

Office Tab - เปิดใช้งานการแก้ไขแบบแท็บและการเรียกดูใน Microsoft Office ทำให้งานเป็นเรื่องง่าย
Kutools for Outlook - เพิ่ม Outlook ด้วยฟีเจอร์ขั้นสูงกว่า 100+ รายการเพื่อประสิทธิภาพที่เหนือกว่า
เพิ่มประสิทธิภาพ Outlook 2021 - 2010 หรือ Outlook 365 ของคุณด้วยฟีเจอร์ขั้นสูงเหล่านี้ เพลิดเพลินกับการทดลองใช้ฟรี 60 วันและยกระดับประสบการณ์อีเมลของคุณ!

ลูกศรสีฟ้าฟองขวาค้นหาและแทนที่หัวข้อการนัดหมายด้วยรหัส VBA

ในส่วนนี้คุณสามารถค้นหาและแทนที่หัวข้อการนัดหมายด้วยรหัส VBA ได้ดังนี้

1. ประการแรกคุณต้องตั้งค่ามาโครให้ต่ำใน Outlook ของคุณ

1) ใน Outlook 2010 และ 2013 คลิก เนื้อไม่มีมัน > Options. และใน ตัวเลือกของ outlook คลิกตกลง ศูนย์ความเชื่อถือ ในแถบด้านซ้ายจากนั้นคลิกไฟล์ การตั้งค่าศูนย์ความเชื่อถือ ปุ่ม

ตัว Vortex Indicator ได้ถูกนำเสนอลงในนิตยสาร ศูนย์ความเชื่อถือ คลิกตกลง การตั้งค่ามาโคร ในแถบด้านซ้ายจากนั้นเลือก เปิดใช้งานมาโครทั้งหมด ตัวเลือกใน การตั้งค่ามาโคร มาตรา. แล้วคลิกไฟล์ OK ปุ่ม. ดูภาพหน้าจอ:

2). ใน Outlook 2007 โปรดคลิก เครื่องมือ > ศูนย์ความเชื่อถือ. ใน ศูนย์ความเชื่อถือ คลิกตกลง การตั้งค่ามาโคร ในแถบด้านซ้ายจากนั้นเลือก ไม่มีการตรวจสอบความปลอดภัยสำหรับมาโคร และคลิกที่ OK ปุ่ม

2 กด อื่น ๆ + F11 คีย์เพื่อเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

3 ใน Microsoft Visual Basic สำหรับแอปพลิเคชัน ดับเบิลคลิกเพื่อขยายไฟล์ project1 > วัตถุ Microsoft Outlook > นี้OutlookSession เพื่อเปิดตัวแก้ไข VBA ดูภาพหน้าจอ:

4. คัดลอกและวางโค้ด VBA ต่อไปนี้ลงในตัวแก้ไข VBA จากนั้นกดปุ่ม F5 กุญแจสำคัญในการเรียกใช้รหัส

VBA: ค้นหาและแทนที่หัวข้อการนัดหมาย

Sub FindReplaceAppointment()
	Dim oApp As Outlook.Application
	Dim oCalFolder As Outlook.MAPIFolder
	Dim oAppt As Outlook.AppointmentItem
	Dim sOldText As String
	Dim sNewText As String
	Dim iCalChangedCount As Integer
	Set oApp = Outlook.Application
	MsgBox ("This script will perform a find/replace in the subject line of all appointments in a specified calendar.")
	sOldText = InputBox("What is the text string that you would like to replace?")
	sNewText = InputBox("With what would you like to replace it?")
	' Check to be sure a Calendar folder was selected
	Do
	If Not (oCalFolder Is Nothing) Then
		If (oCalFolder.DefaultItemType = olAppointmentItem) Then Exit Do
	End If
	MsgBox ("Please select a calendar folder from the following list.")
	Set oCalFolder = Application.Session.PickFolder
	On Error GoTo ErrHandler:
Loop Until oCalFolder.DefaultItemType = olAppointmentItem
' Loop through appointments in calendar, change text where necessary, keep count
iCalChangedCount = 0
For Each oAppt In oCalFolder.Items
	If InStr(oAppt.Subject, sOldText) <> 0 Then
		Debug.Print "Changed: " & oAppt.Subject & " - " & oAppt.Start
		oAppt.Subject    = Replace(oAppt.Subject, sOldText, sNewText)
		oAppt.Save
		iCalChangedCount = iCalChangedCount + 1
	End If
Next
' Display results and clear table
MsgBox (iCalChangedCount & " appointments had text in their subjects changed from '" & sOldText & "' to '" & sNewText & "'.")
Set oAppt = Nothing
Set oCalFolder = Nothing
Exit Sub
	ErrHandler:
	MsgBox ("Macro terminated.")
End Sub

5. หลังจากรันโค้ดแล้ว a Microsoft Outlook กล่องโต้ตอบจะปรากฏขึ้น คลิก OK ปุ่ม

6. ในวินาทีที่ Microsoft Outlook กล่องโต้ตอบป้อนข้อความที่คุณต้องการแทนที่จากนั้นคลิกไฟล์ OK ปุ่ม

7. ในข้อที่สาม Microsoft Outlook กล่องโต้ตอบป้อนข้อความที่คุณต้องการแทนที่แล้วคลิก OK.

หมายเหตุ: หากคุณเพียงต้องการลบคำ "คัดลอก" ทั้งหมดออกจากหัวเรื่องในปฏิทินที่ระบุโปรดเว้นช่องนี้ว่างไว้

8 คลิกที่ OK ในกล่องโต้ตอบด้านล่าง

9 ใน เลือกโฟลเดอร์ กล่องโต้ตอบเลือกปฏิทินของคุณภายใต้บัญชีอีเมลที่ระบุจากนั้นคลิกที่ OK ปุ่ม. ดูภาพหน้าจอ:

10. จากนั้นกล่องโต้ตอบจะปรากฏขึ้นเพื่อแจ้งให้คุณทราบว่าการเปลี่ยนสำเร็จ กรุณาคลิกที่ไฟล์ OK ปุ่ม

11. จากนั้นข้อความทั้งหมดในหัวข้อของปฏิทินที่คุณเลือกจะถูกแทนที่ด้วยเนื้อหาใหม่


สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

Kutools สำหรับ Outlook - คุณสมบัติอันทรงพลังมากกว่า 100 รายการเพื่อเติมพลังให้กับ Outlook ของคุณ

🤖 ผู้ช่วยจดหมาย AI: ส่งอีเมลระดับมืออาชีพทันทีด้วยเวทมนตร์ AI คลิกเพียงครั้งเดียวเพื่อตอบกลับอย่างชาญฉลาด น้ำเสียงที่สมบูรณ์แบบ การเรียนรู้หลายภาษา เปลี่ยนรูปแบบการส่งอีเมลอย่างง่ายดาย! ...

📧 การทำงานอัตโนมัติของอีเมล: ไม่อยู่ที่สำนักงาน (ใช้ได้กับ POP และ IMAP)  /  กำหนดการส่งอีเมล  /  Auto CC/BCC ตามกฎเมื่อส่งอีเมล  /  ส่งต่ออัตโนมัติ (กฎขั้นสูง)   /  เพิ่มคำทักทายอัตโนมัติ   /  แบ่งอีเมลผู้รับหลายรายออกเป็นข้อความส่วนตัวโดยอัตโนมัติ ...

📨 การจัดการอีเมล์: เรียกคืนอีเมลได้อย่างง่ายดาย  /  บล็อกอีเมลหลอกลวงตามหัวเรื่องและอื่นๆ  /  ลบอีเมลที่ซ้ำกัน  /  การค้นหาขั้นสูง  /  รวมโฟลเดอร์ ...

📁 ไฟล์แนบโปรบันทึกแบทช์  /  การแยกแบทช์  /  การบีบอัดแบบแบตช์  /  บันทึกอัตโนมัติ   /  ถอดอัตโนมัติ  /  บีบอัดอัตโนมัติ ...

🌟 อินเตอร์เฟซเมจิก: 😊อีโมจิที่สวยและเจ๋งยิ่งขึ้น   /  เพิ่มประสิทธิภาพการทำงาน Outlook ของคุณด้วยมุมมองแบบแท็บ  /  ลดขนาด Outlook แทนที่จะปิด ...

???? เพียงคลิกเดียวสิ่งมหัศจรรย์: ตอบกลับทั้งหมดด้วยไฟล์แนบที่เข้ามา  /   อีเมลต่อต้านฟิชชิ่ง  /  🕘 แสดงโซนเวลาของผู้ส่ง ...

👩🏼‍🤝‍👩🏻 รายชื่อและปฏิทิน: แบทช์เพิ่มผู้ติดต่อจากอีเมลที่เลือก  /  แบ่งกลุ่มผู้ติดต่อเป็นกลุ่มแต่ละกลุ่ม  /  ลบการแจ้งเตือนวันเกิด ...

เกิน คุณสมบัติ 100 รอการสำรวจของคุณ! คลิกที่นี่เพื่อค้นพบเพิ่มเติม

 

 

Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Many thanks. I think it is the 1st time, I copied and executed your macro "as is" without any error or any need for changes !
This comment was minimized by the moderator on the site
Buongiorno,
è possibile specificare la cartella posizione calendario (es.: \\mail@dominio\Calendario) senza far apparire la richiesta?
Grazie
Hi,
is it possible to specify the folder location calendar (ex .: \\ mail@domain\Calendar) without making the request appear?

Thank you


This comment was minimized by the moderator on the site
I always get a Syntax Error right at the start on the 2nd line at Dim oApp As Outlook.Application. No idea what's wrong :-(

I try to run the VB Script in Outlook 2016 (O365 Version) on Windows 10.
This comment was minimized by the moderator on the site
It seems I'm unable to do this for non-local, or shared calendars. Does anyone know how to do it for shared calendars? I'm set as "owner" for permission level of the shared calendar, but it won't show up in my list of folders when I run the script, only my locally created calendars show up.
This comment was minimized by the moderator on the site
Worked fantastically! Thank you so much!!!
This comment was minimized by the moderator on the site
This should do it for you. Add these 3 lines immediately after line 8 (Set oApp = Outlook.Application). Dim nmSpace As Outlook.NameSpace Set nmSpace = oApp.GetNamespace("MAPI") Set oCalFolder = nmSpace.GetDefaultFolder(olFolderCalendar)
This comment was minimized by the moderator on the site
Thank you! How can we modify it to always use the same calendar, and not show the first pop-up? thank you
This comment was minimized by the moderator on the site
Worked just fine really good It took me some time to understand that this is case sensitive, but that is very good. Thank you
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations