Trigger script without restaring outlook

Gazmoz17

Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
Hi,

Discovered VBA a couple of months ago but only just come back to it. I'm sure when I started having a play with it originally...... I could trigger a script in this outlook session without having to exit and restart outlook. Im not sure if was a script itsself and that enabled me to do this. Something to do with outlook application startup...but I'm struggling to find any reference to it on any forum.

Many Thanks
Gareth
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
There are two ways to restart application start scripts - open VBA editor, click i the script and click Run. Or use a macro to trigger it.

I have this on a button in the ribbon to kickstart the Application_Startup macro when it seems to have failed. Put it in ThisOutlookSession.

Code:
Sub RunStart()
 Call Application_Startup
 MsgBox "App Start Started"
End Sub
 

Gazmoz17

Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
That's great thanks Diane I knew it was a script that I got from you originally 👍😎

Thank you
 

Gazmoz17

Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
I think I've misunderstood maybe as I'm getting an error?

Application startup error.JPG


Application startup error image 2.JPG
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
put it at the bottom of thisoutlooksession module (the one with the blue outlook icon)
 

Gazmoz17

Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
Hi, thanks for reply. So I double clicked the thisoutlooksession . Entered the code to the right of it and ran & get the same error.

Or am I to right click and insert module?...but get the same error when I do this?

Apologies I know its a baby question and frustrating because Ive had it working in the past.

Thanks
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It goes at the end of the code in thisoutlooksession - well, or after the app startup - it doesn't have to be the very last macro.

1625580716083.png
 
Similar threads
Thread starter Title Forum Replies Date
M Subject Line Automation - Trigger Script Delayed Outlook VBA and Custom Forms 2
C must select message to trigger safe list Using Outlook 3
T Sending One Email to Trigger Another Being Sent Using an Email within the 1st? Using Outlook 0
Z Trigger macro to run after a new mail is received in Outlook? Using Outlook 3
D Trigger macro to run when selected email is opened Using Outlook 3
R Trigger Application_ItemSend event when sending using Access macro Outlook VBA and Custom Forms 2
J dragging an calendar item to deleted folder does not trigger ItemRemove event Outlook VBA and Custom Forms 1
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
L Need help modifying a VBA script for emails stuck in Outbox Outlook VBA and Custom Forms 6
L VB script only runs manually Outlook VBA and Custom Forms 5
E Having some trouble with a run-a-script rule (moving mail based on file type) Outlook VBA and Custom Forms 5
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
Aussie Rules Run a Script on an Incoming Email OK and then the Email reverts Outlook VBA and Custom Forms 0
D.Moore VBA script fail after Office 365 update Using Outlook 8
M Outlook 2013 Script Assistance - Save Opened Link with Subject Added Outlook VBA and Custom Forms 1
F Script for zip file attachment Outlook VBA and Custom Forms 1
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
Y Outlook 2013 Run A Script Outlook VBA and Custom Forms 4
Z Script to set account? Using Outlook 0
dweller Outlook 2010 Rule Ignores VBA Script Outlook VBA and Custom Forms 2
N VBA Script to Open highlighted e-mail and Edit Message Outlook VBA and Custom Forms 5
B Outlook rule run a Script doesn't work Outlook VBA and Custom Forms 1
J Calling a Public sub-routine from the script editor via VB script Outlook VBA and Custom Forms 4
K Outlook Archive to PST Files by Date Range VBA Script? Outlook VBA and Custom Forms 1
Peter H Williams Enable script containing VBA Outlook VBA and Custom Forms 12
H VB script in outlook form doesn't work anymore Outlook VBA and Custom Forms 2
A Script to fetch data from mails in restricted collection and sending them to excel Using Outlook 1
B Wanting to run a script that will filter any body that has a russian link in it. Outlook VBA and Custom Forms 5
Bri the Tech Guy Registry Tweak to make "Run a Script" Action Available Outlook VBA and Custom Forms 2
V VB script code to save a specific email attachment from a given email Outlook VBA and Custom Forms 14
Bri the Tech Guy Run Script rule not running for newly arriving messages Outlook VBA and Custom Forms 25
Q Script to create a pst file for Archiving Using Outlook 1
Vijay Error in rule- Run a script Using Outlook 1
R VBA Script Quick Parts Using Outlook 1
Vijay Run script doesn't work in outlook Using Outlook 1
Q VBA Script to move item in secondary mailbox Outlook VBA and Custom Forms 2
Diane Poremsky Run a Script Rule: Send a New Message when a Message Arrives Using Outlook 2
F Avoid sending duplicate using Outlook script Outlook VBA and Custom Forms 2
oliv- How to Run a Script IN AN ADDIN with Outlook's Rules and Alerts Outlook VBA and Custom Forms 2
L Run a Script Rule doesn't work Using Outlook 5
N Outlook script to forward emails based on senders' address Outlook VBA and Custom Forms 2
S using script rule to save attachments on arrival Outlook 2010 Outlook VBA and Custom Forms 9
X Outlook script to run excel data Outlook VBA and Custom Forms 1
N VBA Script to Send Automatic Emails from Outlook 2010 Outlook VBA and Custom Forms 1
Davzell Change default pop3 account with script, prf or registery ? Outlook VBA and Custom Forms 0
D RUN SCRIPT WHEN OUTLOOK IS CLOSE Outlook VBA and Custom Forms 1
L Cannot run script from rule Outlook VBA and Custom Forms 7
O modify vba to run it as script rule Outlook VBA and Custom Forms 8
D Script to parse email and set a task Outlook VBA and Custom Forms 1

Similar threads

Top