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

Outlookの電子メールに日付ピッカーを挿入するにはどうすればよいですか?

作者: シルヴィア 最終更新日:2024年05月09日

同僚に作業スケジュールを送信し、さまざまな日付にさまざまな人にさまざまなタスクを割り当てる必要があるとします。 ただし、手動で日付を入力するのを間違えることが心配なので、代わりに日付ピッカーが必要です。 このチュートリアルでは、Outlookの電子メールに日付ピッカーを挿入するのに役立つ方法を提供します。


Outlookの電子メールにVBAコードを使用して日付ピッカーを挿入します

次のVBAコードを実行して、Outlookの電子メールに日付ピッカーを挿入できます。 以下の手順に従ってください。

  1. Launch your Outlook, press the 他の + F11 キーを押して アプリケーション向け Microsoft Visual Basic 窓。
  2. In the left pane, double click Project1 > MicrosoftOutlookオブジェクト > ThisOutlookSession、 次に、次のVBAコードをにコピーします。 ThisOutlookSession(コード) 窓。
    VBAコード:Outlookの電子メールに日付ピッカーを挿入します
    Sub DatePicker()
    'Updated by Extendoffice 20220615
      Dim xDoc As Document
      On Error Resume Next
      Set xDoc = Application.ActiveInspector.WordEditor
      With xDoc.Application.Selection
        .Range.ContentControls.Add (wdContentControlDate)
        .ParentContentControl.DateDisplayFormat = "MMMM d, yyyy"
        .InsertAfter Format(Now(), "MMMM d, yyyy")
        .MoveRight wdCharacter, 1
      End With
    End Sub
    注: In the code, you can change "MMMM d、yyyy" to the date format you need.
  3. に留まる アプリケーション向け Microsoft Visual Basic ウィンドウ、クリック ツール > 参考文献。
  4. 参照– Project1 ダイアログボックスで Microsoft Word16.0オブジェクトライブラリ チェックボックスをクリックし、 OK を入力して変更を保存してください。
  5. 他の + Q を閉じるためのキー アプリケーション向け Microsoft Visual Basic 窓。
  6. Mail 表示するには、をクリックします 新しいメール ボタンの下に ホーム タブをクリックして、新しいメールを作成します。
  7. メッセージ ウィンドウをクリックします。 クイックアクセスツールバーをカスタマイズする (Comma Separated Values) ボタンをクリックして、各々のジョブ実行の詳細(開始/停止時間、変数値など)のCSVファイルをダウンロードします。 、次に選択 その他のコマンド ドロップダウンメニューから。 スクリーンショットを参照してください:
  8. Outlookのオプション ウィンドウの場合、次のように構成する必要があります。
    1. 選択する マクロ セクションに からコマンドを選択します ドロップダウンリスト;
    2. Select the script you created above in the left commands box;
    3. クリック Add
    4. Keep the script selected in the right box, and then click the 修正します ボタン。 の中に 変更ボタン ダイアログボックスで、スクリプトに新しいボタンを割り当て、クリックします [OK]をクリックします。
    5. クリック OK セクションに Outlookのオプション 変更を保存するウィンドウ。
  9. VBAスクリプトがに追加されました クイックアクセスツールバー 指定したアイコンとして表示されます。
  10. 今後、メールを作成するときに、上の日付ピッカーアイコンをクリックできます クイックアクセスツールバー メール本文に日付ピッカーを挿入し、そこから必要な日付を選択します。 次のデモを参照してください。
注意:
  • You can insert multiple date pickers into the body of an email.
  • You can change the date you have selected: click on the date field to display the Date control, then select a new date as needed.
  • This date picker can also be inserted into the body of an appointment or a task. If you need to, create a new appointment or task and repeat the step 7-8 above to achieve it.
  • If you restart Outlook and find that the script does not run. That's because the macro was disabled. You need to follow the steps below to re-enable the macro:
    1. ソフトウェアの制限をクリック File > オプション に入る Outlookのオプション 窓。
    2. ソフトウェアの制限をクリック トラストセンター (英語のみ) > セキュリティセンターの設定.
    3. トラストセンター (英語のみ) ウィンドウをクリックします マクロ設定 タブを選択 すべてのマクロを有効にする オプションをクリックして OK > OK 新しい設定を保存します。
    4. Restart Outlook once more.

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

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

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

📧 自動メール: 不在時 (POP および IMAP で利用可能)  /  メール送信のスケジュール設定  /  メール送信時のルールによる自動CC/BCC  /  自動転送 (高度なルール)   /  あいさつを自動追加   /  複数受信者の電子メールを個別のメッセージに自動的に分割する ...

📨 電子メール管理: メールを簡単に思い出す  /  件名などで詐欺メールをブロック  /  重複するメールを削除する  /  高度な検索  /  フォルダーを統合する ...

📁 アタッチメント プロバッチ保存  /  バッチデタッチ  /  バッチ圧縮  /  自動保存   /  自動デタッチ  /  自動圧縮 ...

🌟 インターフェースマジック: 😊もっと可愛くてクールな絵文字   /  タブ付きビューで Outlook の生産性を向上  /  Outlook を閉じる代わりに最小化する ...

???? ワンクリックの驚異: 受信した添付ファイルをすべてに返信する  /   フィッシングメール対策  /  🕘送信者のタイムゾーンを表示 ...

👩🏼‍🤝‍👩🏻 連絡先とカレンダー: 選択したメールから連絡先を一括追加  /  連絡先グループを個別のグループに分割する  /  誕生日のリマインダーを削除する ...

オーバー 100の特長 あなたの探索をお待ちしています! ここをクリックして詳細をご覧ください。

 

 

Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
WHEN I CLOSE THE OUTLOOK AND RESTAR THIS IS NOT WORKING, WHY? CAN YOU HELP
This comment was minimized by the moderator on the site
Hi,

I'm very sorry, this issue occurred because macros were disabled after restarting Outlook. Please follow these steps to re-enable macros:
Click on File > Options to enter the Outlook Options window, click on Trust Center > Trust Center Settings, in the Trust Center window, click on the Macro Settings tab, select the Enable all macros option, and click OK to save the new settings. Please restart Outlook once more, and the issue should be resolved.
This comment was minimized by the moderator on the site
Hello. Very clear instructions, thank you.
When I attempt to use the macro, I get this error:
"Compile error: User defined type not defined."
Sub DatePicker() and xDoc As Document are highlighted.
Any ideas on how to fix it please?
This comment was minimized by the moderator on the site
Hi Dave,

To solve this problem, please follow the instruction of step 3 and 4 to enable the Microsoft Word 16.0 Object Library option in the Microsoft Visual Basic for Applications window.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/outlook-word-referece-vba.png?1711618070
This comment was minimized by the moderator on the site
This was exactly what I was looking for. 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