Loncat ke daftar isi utama

Bagaimana cara mencari dan mengganti subjek janji temu di kalender Outlook?

Menemukan dan mengganti subjek janji temu di kalender Outlook sangat membantu saat Anda menemukan beberapa subjek perlu diganti dengan teks yang sama secara massal. Atau ganti kata Salin di bidang subjek setelah data diimpor di Outlook. Artikel ini memberi Anda kode VBA untuk mencari dan mengganti beberapa subjek janji temu. Silakan telusuri untuk lebih jelasnya.

Cari dan ganti subjek janji temu dengan kode VBA

Tab Office - Aktifkan Pengeditan dan Penjelajahan dengan Tab di Microsoft Office, Membuat Pekerjaan Menjadi Mudah
Kutools for Outlook - Tingkatkan Outlook dengan 100+ Fitur Lanjutan untuk Efisiensi Unggul
Tingkatkan Outlook 2021 - 2010 atau Outlook 365 Anda dengan fitur-fitur canggih ini. Nikmati uji coba gratis 60 hari yang komprehensif dan tingkatkan pengalaman email Anda!

panah gelembung kanan biruCari dan ganti subjek janji temu dengan kode VBA

Di bagian ini, Anda dapat mencari dan mengganti subjek janji temu dengan kode VBA sebagai berikut.

1. Pertama, Anda perlu mengatur pengaturan makro ke rendah di Outlook Anda.

1) Di Outlook 2010 dan 2013, klik File > Opsi. Dan di Pilihan Outlook kotak dialog, klik Trust Center di bilah kiri, lalu klik Pengaturan Pusat Kepercayaan .

Dalam majalah Trust Center kotak dialog, klik Pengaturan Makro di bilah kiri, lalu pilih Aktifkan semua makro pilihan dalam Pengaturan Makro bagian. Dan klik OK tombol. Lihat tangkapan layar:

2). Di Outlook 2007, silakan klik Tools > Trust Center. di Trust Center kotak dialog, klik Pengaturan Makro di bilah kiri, lalu pilih Tidak ada pemeriksaan keamanan untuk makro pilihan dan klik OK .

2. tekan lain + F11 kunci untuk membuka Microsoft Visual Basic untuk Aplikasi jendela.

3. Dalam Microsoft Visual Basic untuk Aplikasi jendela, klik dua kali untuk memperluas project1 > Objek Microsoft Outlook > Sesi Pandangan ini untuk membuka editor VBA. Lihat tangkapan layar:

4. Salin dan tempel kode VBA berikut ke editor VBA. Dan kemudian tekan F5 kunci untuk menjalankan kode.

VBA: temukan dan ganti subjek janji temu

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. Setelah menjalankan kode, a Microsoft Outlook kotak dialog muncul. Klik OK .

6. Di kedua Microsoft Outlook kotak dialog, masukkan teks yang ingin Anda ganti, lalu klik OK .

7. Di urutan ketiga Microsoft Outlook kotak dialog, masukkan teks yang ingin Anda ganti, dan klik OK.

Note: Jika Anda hanya ingin menghapus semua kata "Salin" dari subjek di kalender tertentu, biarkan kotak ini kosong.

8. Klik OK tombol di kotak dialog di bawah ini.

9. Dalam Pilih Folder kotak dialog, pilih kalender Anda di bawah akun email yang ditentukan, lalu klik OK tombol. Lihat tangkapan layar:

10. Kemudian kotak dialog akan muncul untuk memberi tahu Anda bahwa penggantian berhasil. Silakan klik OK .

11. Dan kemudian semua teks dalam mata pelajaran Anda dari kalender yang dipilih telah diganti dengan konten baru.


Alat Produktivitas Kantor Terbaik

Kutools untuk Outlook - Lebih dari 100 Fitur Canggih untuk Meningkatkan Outlook Anda

🤖 Asisten Surat AI: Email profesional instan dengan keajaiban AI--satu klik untuk mendapatkan balasan jenius, nada sempurna, penguasaan multibahasa. Ubah email dengan mudah! ...

📧 Email Otomatis: Di Luar Kantor (Tersedia untuk POP dan IMAP)  /  Jadwal Kirim Email  /  Auto CC/BCC Sesuai Aturan Saat Mengirim Email  /  Penerusan Otomatis (Aturan Lanjutan)   /  Tambah Salam Otomatis   /  Secara Otomatis Membagi Email Multi-Penerima menjadi Pesan Individual ...

📨 email Management: Mengingat Email dengan Mudah  /  Blokir Email Penipuan berdasarkan Subjek dan Lainnya  /  Hapus Email Duplikat  /  Pencarian  /  Konsolidasi Folder ...

📁 Lampiran ProPenyimpanan Batch  /  Pelepasan Batch  /  Kompres Batch  /  Penyimpanan otomatis   /  Lepaskan Otomatis  /  Kompres Otomatis ...

🌟 Antarmuka Ajaib: 😊Lebih Banyak Emoji Cantik dan Keren   /  Tingkatkan Produktivitas Outlook Anda dengan Tampilan Tab  /  Minimalkan Outlook Daripada Menutup ...

👍 Keajaiban sekali klik: Balas Semua dengan Lampiran Masuk  /   Email Anti-Phishing  /  🕘Tampilkan Zona Waktu Pengirim ...

👩🏼‍🤝‍👩🏻 Kontak & Kalender: Batch Tambahkan Kontak Dari Email yang Dipilih  /  Bagi Grup Kontak menjadi Grup Individual  /  Hapus Pengingat Ulang Tahun ...

Lebih 100 Fitur Tunggu Eksplorasi Anda! Klik Di Sini untuk Menemukan Lebih Banyak.

 

 

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