Sign in to follow this  
Followers 0
cookiemonster

Outlook 2003 create appointment

89 posts in this topic

Just wondered if anyone out there has created a script to product an appointment in outlook that I could look at to try and assistant an idea of something I would like to make

Share this post


Link to post
Share on other sites



Please have a look at my OutlookEX UDF (for download please see my signature). Function _OL_ItemCreate should do what you want. Check the _OL_ItemCreate.au3 example file as well.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Now go to a point where im stuck as its not reading the data from the combo box for the start time.

Ive got this for my combo box for start time:

$starttimeinput = GUICtrlCreateCombo("", 288, 72, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$starttimeinput = GUICtrlSetData(-1, "09:00|09:30|10:00|10:30|11:00|11:30|12:00|12:30|13:00|13:30|14:00|14:30|15:00|15:30|16:00|16:30")

and then ive got this that reads the date and changes the format (works fine) but it wont read the time from the combo box

$date = GUICtrlRead($dateinput)
$timestart = GUICtrlRead($starttimeinput)
$date2 = StringSplit($date,"/")
$datetime = $date2[3] & "-" & $date2[2] & "-" & StringRight($date2[1] & " " & $timestart,4)
MsgBox(0,"",$date & @crlf & $datetime & @crlf & $timestart)

But it just returns a 0 rather than the selected data in combo box, eg: 12:00

Any ideas?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Modify line

$starttimeinput = GUICtrlSetData(-1, "09:00|09:30|10:00|10:30|11:00|11:30|12:00|12:30|13:00|13:30|14:00|14:30|15:00|15:30|16:00|16:30")
to
GUICtrlSetData(-1, "09:00|09:30|10:00|10:30|11:00|11:30|12:00|12:30|13:00|13:30|14:00|14:30|15:00|15:30|16:00|16:30")
If you check the help file you will see that GUICtrlSetData returns 0!

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

oh i thought i needed the variable at the start? so removing that bit should sort this issue out? Cheers man

Share this post


Link to post
Share on other sites

Yes, this should solve the problem.

After GUICtrlCreateCombo $starttimeinput holds the Id of the control. After GUICtrlSetData $starttimeinput holds the return value (= 0). When you then do the GUICtrlRead($starttimeinput) you read the wrong control.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Many thanks for explaining that, yes it did work, but even better thanks to your explanation i understand why it didn't work before and why it now works :) cheers!

Share this post


Link to post
Share on other sites
:D

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Water,

My script is now completly built and works perfectly to the way I wanted to.

Now I see theirs the Warnings script so I dont need to click yes when outlook says an external program is trying to access outlook.

Now I usually have outlook open and running all the time, ive gone into the warning script and the func says this after adding my bits:

Func _OL_Open($bWarningClick = True, $sWarningProgram = "C:\Documents and Settings\james.q\Desktop\_OL_Warnings.au3", $iWinCheckTime = 1000, $iCtrlCheckTime = 1000, $sProfileName = "", $sPassword = "")

However im getting 'Error creating a connection to Outlook. @error = 5, @extended = 0'

Struggling to identify the problem, any ideas? (seen as youve been a star helping so far!)

Share this post


Link to post
Share on other sites

And can the warning program be built into the one exe or does this need to be a separate exe?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

You only need to pass the parameters, not the names:

_OL_Open(True, "C:\Documents and Settings\james.q\Desktop\_OL_Warnings.exe", 1000, 1000, "", "")
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

And can the warning program be built into the one exe or does this need to be a separate exe?

Needs to be compiled to a sparate exe which then is called by _OL_Open.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

could I not incorporate the warning function into my script so its all one exe? and just have it call that function at the right time?

Share this post


Link to post
Share on other sites

infact that doesnt really matter, I could just chuck the warning exe into outlooks main program files folder so its out the way, then point it to that place

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

I changed it to

_OL_Open(True, "C:\Documents and Settings\james.q\Desktop\_OL_Warnings.exe", 1000, 1000, "", "")

But now im getting 'badly formatted "Func" statement'

Any ideas?

This is in the OutlookEX.au3 file that im changing it

Edited by quinnj09

Share this post


Link to post
Share on other sites

could I not incorporate the warning function into my script so its all one exe? and just have it call that function at the right time?

It could be incorporated in the main script by using AdLibRegister. But I never found the time and there was no need from the users to modify the UDF.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I changed it to

_OL_Open(True, "C:\Documents and Settings\james.q\Desktop\_OL_Warnings.exe", 1000, 1000, "", "")

But now im getting 'badly formatted "Func" statement'

Any ideas?

This is in the OutlookEX.au3 file that im changing it

There is absolute NO need to modify OutlookEX.au3!

You have to modify the call of _OL_Open in YOUR script!


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Or you could use FileInstall and add the Warning Exe to your script Exe.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

It could be incorporated in the main script by using AdLibRegister. But I never found the time and there was no need from the users to modify the UDF.

What would be the difference on doing AdLibReigster instead of Call?

There is absolute NO need to modify OutlookEX.au3!

You have to modify the call of _OL_Open in YOUR script!

Appolgise didnt realise that, so i reverted back to an original copy of outlookex, and used

$oOutlook = _OL_Open(True, "C:\Documents and Settings\james.q\My Documents\Autoit Files\UpgradeBooker\_OL_Warnings.exe", 1000, 1000, "", "")

However im now getting 'Error creating a connection to Outlook. @error = 6, @extended = 1'

Am i right from reading the OutlookEX that this error means:

|6 - Run error when running $sWarningProgram. Please check @extended for more information

|1 - Outlook was already up and running. When using _OL_Open you have to set parameter $bForceClose to True to stop the Outlook process (optional)

but im a bit lost on where I set $bForceClose to true?

Cheers!

Share this post


Link to post
Share on other sites

With AdLibRegister you can start a function every x milliseconds (doesn't matter which statement of your script is currently being executed).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0