メインコンテンツへスキップ

Outlookカレンダーで予定の件名を検索して置き換える方法は?

Outlookカレンダーで予定の件名を検索して置き換えると、一部の件名を同じテキストにまとめて置き換える必要がある場合に役立ちます。 または、Outlookにデータをインポートした後、件名フィールドの「コピー」という単語を置き換えます。 この記事では、複数の予定の件名を検索して置き換えるためのVBAコードを提供します。 詳細については、参照してください。

予定の件名を検索してVBAコードに置き換えます

Office タブ - Microsoft Office でタブによる編集と参照を有効にし、仕事をスムーズにします
Kutools for Outlook - 100 以上の高度な機能で Outlook を強化し、優れた効率を実現します
これらの高度な機能を使用して、Outlook 2021 ~ 2010 または Outlook 365 を強化します。 包括的な 60 日間の無料トライアルを利用して、メール エクスペリエンスを向上させてください。

矢印青い右バブル予定の件名を検索してVBAコードに置き換えます

このセクションでは、次のように予定の件名を検索してVBAコードに置き換えることができます。

1.まず、Outlookでマクロ設定を低く設定する必要があります。

1)Outlook 2010および2013で、 File > オプション。 とで Outlookのオプション ダイアログボックスで、をクリックします。 トラストセンター (英語のみ) 左側のバーで、をクリックします セキュリティセンターの設定

トラストセンター (英語のみ) ダイアログボックスで、をクリックします。 マクロ設定 左側のバーで、を選択します すべてのマクロを有効にする 内のオプション マクロ設定 セクション。 そして、 OK ボタン。 スクリーンショットを参照してください:

2)。 Outlook 2007では、をクリックしてください ツール > トラストセンター (英語のみ)。 の中に トラストセンター (英語のみ) ダイアログボックスで、をクリックします。 マクロ設定 左側のバーで、を選択します マクロのセキュリティチェックはありません オプションをクリックして OK

2。 プレス 他の + F11 キーを押して アプリケーション向け Microsoft Visual Basic 窓。

3。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウで、ダブルクリックして展開します project1 > MicrosoftOutlookオブジェクト > この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.コードを実行した後、 Microsoft Outlookの ダイアログボックスが表示されます。 クリック OK

6番目に Microsoft Outlookの ダイアログボックスで、置き換えるテキストを入力し、[ OK

7番目に Microsoft Outlookの ダイアログボックスで、置き換えるテキストを入力し、をクリックします OK.

Note:指定したカレンダーの件名からすべての「コピー」単語を削除するだけの場合は、このボックスを空白のままにしてください。

8。 クリック OK 下のダイアログボックスのボタン。

9。 の中に フォルダを選択してください ダイアログボックスで、指定したメールアカウントでカレンダーを選択し、[ OK ボタン。 スクリーンショットを参照してください:

10.次に、交換が成功したことを通知するダイアログボックスが表示されます。 クリックしてください OK

11.次に、選択したカレンダーの件名のすべてのテキストが新しいコンテンツに置き換えられました。


最高のオフィス生産性向上ツール

Outlook用Kutools - Outlook を強化する 100 以上の強力な機能

🤖 AIメールアシスタント: AI の魔法を備えたインスタント プロのメール - ワンクリックで天才的な返信、完璧な口調、多言語の習得。メールを簡単に変革しましょう! ...

📧 自動メール: 不在時 (POP および IMAP で利用可能)  /  メール送信のスケジュール設定  /  メール送信時のルールによる自動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