Script to Macro in Module

Status
Not open for further replies.
That is weird. Are you putting it on a separate read page?
 
No....and to test the situation, I added a text boxt to it from the field list, and it's the same problem...in the new contact, it does no show the new text box...

Since I am in the Office 365 acccount using Microsoft Exchange Service, is there something not working? Or is there a limitation on the the number of things you put in a contact?

Or any other thougths to fix this, as what I learned from you re the runthis and I found out make it a Public Sub in the Outlook Session area and then the code for the script re an application, it will totally upgrade what I need.
 
There is a limitation in the number of controls, but its a high number. (The exact number varies with the number of controls).

Is it published with a new version #? That can affect it, although you should be the wrong one in the designer too (if you use New item then go into designer.)
 
Please explain what I need to look into? I have my form that you helped me create, and I published it as a separate one to the personal folder as that way it was the same new form, but if I was working to change something, I worked from he second new form it did not affect my contacts until it worked I don't want you mean by a version number and don't don't now how to go the "into designer....If you could tell what to try in details I appreciate it much as this new update it wonderful.
 
I redid it thru other contact form that is the form I use....and published it.....and its working!!!!!!
 
I found a way to do this and wanted to let others know if this helps others:

This is what I put in TheOutlookSession area.....and the second line is a macro name from a Module so when I run the code from TheOutlookSession area it runs that the Macro of the Module, which opens up a combobox from a userform and gives me list of things from the combobox to decide to put in or run from the contact.

Public Sub runthis()

macroname

End Sub

I added a commandbutton5 to the Contact form with a caption name that shows what I want to do, and here is what I put in the Script area of the Contact form, and published it as my default form.

Sub CommandButton5_Click

Set myOlApp = CreateObject("Outlook.Application")

myOlApp.runthis

End Sub

And when I click on the CommandButton5 in any Contact, it runs the macro that was put in TheOutlookSessionArea
 
It was working, and now, with no changes, it is not working........what should I do as it was working perfectly
 
Update on this please as i works and then it says the "Object does not support this property method myOlApp.runthis" I can we fix this please?
 
Happy to hear back, and I recently learned from a couple of other areas, that its putting a different structure in the script, and clicking on the commandbutton in the contact runs the macro from the OutlookSession that runs the macro from the Module and opens up the Useform Commbobox. So here is the other way to do it, and will see if it never has that quick error from time to time:

Sub

CommandButton5_click




call test




end sub



sub test()



Application.runthis()




end sub
 
It works and then the Same error comes up: Object does not support this property method myOlApp.runthis, and later it works. What to fix please?
 
object does not support this property means you are trying to do something not supported by whatever you are using. So it works the first then doesn't?
 
It often just works in a normal way for a lontime and then it shows up with the error. Any idea to fix ??
 
No, not really. My best guess is that an object is left open somewhere along the line and repeated use of it causes problems. Or you are calling the wrong item type - like using a contact macro with a contact group or a contact macro on an email.

The code at the end of many macros that reads Set objectname = nothing is closing the objects. Not everything declared at the top of the macro needs to be set to nothing though, so I'm not sure this is the problem. The error message isn't right for this either. If it's because you are trying to use it with the wrong item type, you can add code to check for the item type, or just remember it not to use it with other forms.
 
As a report just in case you have more thoughts. The same macro that it run froms the macro in OutlookSessions area (that have a the script of the contact to run from the OutlookSession macro) I dragged it to the Quick Access Toolbar of the Contact form, and it works from there....and when the commandbotton re the Script does not work, and then I run that macro from the Quick Access Toolbar, I do the commandbotton again and it works....
 
So the command button is dying?
 
Not at all.



The macro in the OulookSession is



Public Sub runthis()

macronnamefrommodule

End Sub



And the script code in the contact is:



SubCommandButton5_Click



Set myOlApp =CreateObject("Outlook.Application")

myOlApp.runthis



End Sub



And the commandbutton of the contact is the name : CommandButton5



And I drag the macro called macronamefrommodule to the QuickAccess Toolbar.



So if I click on the CommandButton in the Contact and it doesnot runs the macro from the OutlookSession called"macronamefrommodule", I run the macro from the Quick Access Toolbar,which works, and then the CommandButton click is fixed and works for awhile…

 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
J VBS Script (macro) for word to open Outlook template. Outlook VBA and Custom Forms 2
P Vba script including macro appears in rules but wont run Outlook VBA and Custom Forms 6
L Outlook 2007 Macro to Run a Script From a Contact Form Using Outlook 41
E New Macro/Script needed Using Outlook 5
R Script for simplifying spam control Outlook VBA and Custom Forms 8
J Outlook Rules VBA Run a Script - Multiple Rules Outlook VBA and Custom Forms 0
N Outlook 2021 'Run Script" Rules? Outlook VBA and Custom Forms 4
K Run a script rule to auto 'send again' on undeliverable emails? Outlook VBA and Custom Forms 1
W Designer Form 2013 and Script ? how ? Outlook VBA and Custom Forms 1
G print attachment straight away; working script edit not working Outlook VBA and Custom Forms 0
G Save attachment run a script rule Outlook VBA and Custom Forms 0
FryW Need help modifying a VBA script for in coming emails to auto set custom reminder time Outlook VBA and Custom Forms 0
G Script does not exist Outlook VBA and Custom Forms 0
G Trigger script without restaring outlook Outlook VBA and Custom Forms 7
A VBA Script - Print Date between first email in Category X and last email in Category Y 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
M Subject Line Automation - Trigger Script Delayed Outlook VBA and Custom Forms 2
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

Similar threads

Back
Top