Jump to content

OutlookEX UDF - Help & Support (IV)


water
 Share

Recommended Posts

OutlookEX_Base.au3 will only be contained in OutlookEX.ZIP

Both Readme.txt fiiles have been updated

Hope to release the latest version of OutlooKEX_GUI quite soon :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I was going to write a lot of nonsense here, but then I figured it out. :)

I do have a different question: This UDF deals with Outlook, and I know there are the Excel and AD UDFs, but the same logic should apply to MS Word, correct?

 

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Yes, the Word UDF should work the same.
The wiki should answer some of your questions ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I got this to work, got up to make coffee, and now all I get is 43 :(

Global $g__Object_Outlook_OLM = _OL_Open() ; create a single global object
;If @error <> 0 Then Exit MsgBox(16, "MSO Notify Error", "Error creating a connection to Outlook. Please open Outlook before starting Notify. " & @CRLF & @CRLF & "@error = " & @error & ", @extended = " & @extended)
; does not "use" Outlook object, waits for event. Not open, no problem

Global $oTemp = ObjEvent($g__Object_Outlook_OLM, "oOL_") ; Create the application-level event handler
Global $sOccurrenceName = 'OutlookUDF_ideas'
Global $g__DebugScript = True, $hFileOpenDebugLog = "" ;   False   True









; Fail Safe EXIT if MSO not found
If Not IsObj($g__Object_Outlook_OLM) Then Exit



If _Singleton($sOccurrenceName) = 0 Then ; first check log writing, then kill if already running
    If $g__DebugScript Then FileWriteLine($hFileOpenDebugLog, _Now() & " Another instance is already running. Stopped. " & @CRLF)
    Exit
EndIf

TrayTip("", "OutlookUDF_ideas", 10, 0)
Initialization()





While 1
    Sleep(10)
WEnd
ConsoleWrite("____________________________________________________________ " & @CRLF)

Func oOL_NewMailEx($sEntryIDs) ; https://docs.microsoft.com/en-us/office/vba/api/outlook.application.newmailex
    Local $iItemCount, $oItem
    Local $aEntryIDs = StringSplit($sEntryIDs, ",", $STR_NOCOUNT) ; multiple EntryIDs are separated by ,
    $iItemCount = UBound($aEntryIDs)
    ConsoleWrite("OutlookEX UDF Example Script - " & ($iItemCount = 1 ? "new item has" : "new items have") & " arrived!" & @CRLF & @CRLF)
    For $i = 0 To $iItemCount - 1
        $oItem = $g__Object_Outlook_OLM.Session.GetItemFromID($aEntryIDs[$i], Default) ; Translate the EntryID string to the item object
ConsoleWrite("From:    " & $oItem.SenderName & @CRLF & "Subject: " & $oItem.Subject & @CRLF & "Class:   " & $oItem.Class & " (43=Mail, 53=MeetingRequest ...)" & @CRLF)
    Next

EndFunc   ;==>oOL_NewMailEx



; does not work ;;; ;$oItem = $g__Object_Outlook_OLM.Inspector.ActiveInspector.CurrentItem
Func oOL_ItemSend($oItem) ; https://docs.microsoft.com/en-us/office/vba/api/outlook.application.itemsend
    ConsoleWrite("OutlookEX UDF Example Script - new item has been sent!" & @CRLF & @CRLF)
    ConsoleWrite("line 96 ----------------------------------- " & @CRLF)
    ConsoleWrite(".Class:             " & $oItem.Class & @CRLF)
    ConsoleWrite(".Recipients:        " & $oItem.Recipients & @CRLF)
    ConsoleWrite(".Sender:            " & $oItem.Sender & @CRLF)
    ConsoleWrite(".SenderEmailAddress:" & $oItem.SenderEmailAddress & @CRLF)
    ConsoleWrite(".SenderName:        " & $oItem.SenderName & @CRLF)
    ConsoleWrite(".Sent:              " & $oItem.Sent & @CRLF)
    ConsoleWrite(".SentOn:            " & $oItem.SentOn & @CRLF)
    ConsoleWrite(".Subject:           " & $oItem.Subject & @CRLF)
    ConsoleWrite(".To:                " & $oItem.To & @CRLF)
    If $oItem.Class = 43 Then SQLite_Write_Event($oItem.Class, 'Sent', $oItem.SenderName, $oItem.Recipients, $oItem.Subject)
    SQLite_Write_Event('43', 'Sent', 'Name', 'Recipients', 'Subject')
EndFunc   ;==>oOL_ItemSend

 

This modification return 43 but nothing else

$oItem = $g__Object_Outlook_OLM.Inspector.ActiveInspector.CurrentItem
Func oOL_ItemSend($oItem)

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

43 stands for "MailItem" (https://docs.microsoft.com/en-us/office/vba/api/outlook.olobjectclass)

Recipients is a collection of objects - can't be displayed using ConsoleWrite

Can you please post the whole output you get?

 

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

OutlookEX UDF Example Script - new item has been sent!

line 96 ----------------------------------- 
.Class:             
.Recipients:        
.Sender:            
.SenderEmailAddress:
.SenderName:        
.Sent:              
.SentOn:            
.Subject:           
.To:

🤷‍♀️

I am aware that 43 is for mail item. The problem is that that it the only data I am recovering.

And about 2 hours ago I actually had data on screen 😖

I suspect there may also be an issue with opening OL before/after the script

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Please post the whole script you are running so I can play with it.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You can't grab the send event the same way you grab a newmail event.

The following script modifies the subject of a mail before sending:

#include <OutlookEX.au3>

; *****************************************************************************
; Example Script
; Handle Outlook event when a new item is being sent.
; This example script checks for mail items and changes the subject before the mail is
; being sent.
; This script loops until Shift-Alt-E is pressed to exit.
; *****************************************************************************
HotKeySet("+!e", "_Exit") ;Shift-Alt-E to Exit the script
MsgBox(64, "OutlookEX UDF Example Script", "Hotkey to exit the script: 'Shift-Alt-E'!")

Global $oOL = _OL_Open()
Global $oEvent = ObjEvent($oOL, "_oItems_")

While 1
    Sleep(50)
WEnd

; ItemSend event - https://docs.microsoft.com/en-us/office/vba/api/outlook.application.itemsend
Volatile Func _oItems_ItemSend($oItem, $bCancel)
    #forceref $bCancel
    $bCancel = False ; If you do not want to send the item then set $bCancel to True
    If $oItem.Class = $olMail Then
        $oItem.Subject = "Modified by AutoIt script: " & $oItem.Subject
        $oItem.Save()
    EndIf
EndFunc   ;==>oItems_ItemSend

Func _Exit()
    Exit
EndFunc   ;==>_Exit

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Version 1.6.4.0 of the UDF has been released.

Please test before using in production!

For download please see my signature.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Slight change of tactics. I want to create an email item inside the Outlook inspector, ready for the user to edit/send/cancel.

I know how to send email, now, I don't want to send. I want to create an email and present it to the user.

Example would be to click on a name in a display list, open an item and the associated address gets placed into the To box and presented to the user.

 

I am not sure if Ex or GUI is the right UDF to use. 

___________________________

I think I found what I was looking for :)

EX _ItemCreate  :)

Thanks 

😬Not quite

I can create the email inside folder of choice (Drafts) but ideally I want the dialogie to pop out? I don't want to the user to search for the email?

 

Edited by Skysnake

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

$oItem.Display?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

:)

Dear @water thank you for all your patience. I can now send on another account  :)

I can display email :)

Also, from what I see the current UDF versions work on MS Office 2013 and 365.

Thank you for all your effort. 💪

Skysnake

Why is the snake in the sky?

Link to comment
Share on other sites

Glad your problem has been solved :)

The OutlookEX UDF should work on all on premise versions of Outlook (a few functions will return an error if run < Outlook 2007).

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

This code hangs my outlook (and never returns, after item create line). I am just trying to extract the attachments out of a msg file.
I have tried about 10 different msg files that open fine (when i manually double click and view them in outlook), so i don't think the msg file is the issue.
Using Office 365. I guess its just a security or permissions issue at my end?
Just thought I'd ask incase it is something obvious I am doing wrong.
I'll just have to do it in VBA :(

#include <OutlookEx\OutlookEX.au3>

$fileName = "c:\temp\nobles\test.msg"

Global $oOutlook = _OL_Open()
if @error then ConsoleWriteLine ("_OL_Open ERROR: " & @error&" " &@extended)
$oItem = _OL_Itemcreate($oOutlook, $olMailItem, "", $fileName)
if @error then ConsoleWriteLine ("_OL_Itemcreate ERROR: " & @error&" " &@extended)

_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp",$olHTML,2+16)
if @error then ConsoleWriteLine ("_OL_ItemSave ERROR: " & @error&" " &@extended)
$oItem.Close(1)

func ConsoleWriteLine($text)
    ConsoleWrite($text&@CRLF)
EndFunc

image.png.256bb1684ae300c276fe8e5facdba9c9.pngimage.png.e517206e9d726d81888a7660c50baf76.png 

Edited by boomingranny
Link to comment
Share on other sites

Let's check which function hangs your script:

#include <OutlookEx\OutlookEX.au3>

$fileName = "c:\temp\nobles\test.msg"

Global $oOutlook = _OL_Open()
if @error then ConsoleWriteLine ("_OL_Open ERROR: " & @error&" " &@extended)
ConsoleWriteLine ("Creating the mail item")
$oItem = _OL_Itemcreate($oOutlook, $olMailItem, "", $fileName)
if @error then ConsoleWriteLine ("_OL_Itemcreate ERROR: " & @error&" " &@extended)
ConsoleWriteLine ("Done")

ConsoleWriteLine ("Saving the item")
_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp",$olHTML,2+16)
if @error then ConsoleWriteLine ("_OL_ItemSave ERROR: " & @error&" " &@extended)
ConsoleWriteLine("Done")
$oItem.Close(1)

func ConsoleWriteLine($text)
    ConsoleWrite($text&@CRLF)
EndFunc

BTW:

_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp",$olHTML,2+16)

needs to be (note the trailing backslash for the path):

_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp\",$olHTML,2+16)

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

On 5/14/2021 at 4:15 PM, water said:

Let's check which function hangs your script:

#include <OutlookEx\OutlookEX.au3>

$fileName = "c:\temp\nobles\test.msg"

Global $oOutlook = _OL_Open()
if @error then ConsoleWriteLine ("_OL_Open ERROR: " & @error&" " &@extended)
ConsoleWriteLine ("Creating the mail item")
$oItem = _OL_Itemcreate($oOutlook, $olMailItem, "", $fileName)
if @error then ConsoleWriteLine ("_OL_Itemcreate ERROR: " & @error&" " &@extended)
ConsoleWriteLine ("Done")

ConsoleWriteLine ("Saving the item")
_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp",$olHTML,2+16)
if @error then ConsoleWriteLine ("_OL_ItemSave ERROR: " & @error&" " &@extended)
ConsoleWriteLine("Done")
$oItem.Close(1)

func ConsoleWriteLine($text)
    ConsoleWrite($text&@CRLF)
EndFunc

BTW:

_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp",$olHTML,2+16)

needs to be (note the trailing backslash for the path):

_OL_ItemSave($oOutlook, $oItem, Default,"c:\temp\",$olHTML,2+16)

 

Thanks for the help water, and sorry for not getting back to you sooner.

I tried VBA, i tried this, i tried that, and i finally worked out that

Application.CreateItemFromTemplate 'crashes outlook (most of the time)


but

Session.OpenSharedItem 'works fine

for my setup (Corporate Office 365 copy of Outlook)

So here is the code i ended up using that worked for me:
 

ConsoleWrite("Connecting to Outlook..."&@CRLF)
global $OutlookObject =ObjCreate("Outlook.Application")

func Outlook_SaveAttachmentsFromMSG($fileName,$ExtensionFilter="*",$prefix="YYYYMMDD ")
    $filePath= FileGetPath($fileName)
    if StringLeft($ExtensionFilter,2) = "*." then $ExtensionFilter = StringTrimLeft($ExtensionFilter,2)

    $prefix = StringReplace($prefix,"DD",@MDAY)
    $prefix = StringReplace($prefix,"MM",@MON)
    $prefix = StringReplace($prefix,"YYYY",@YEAR)

    $msg = $OutlookObject.Session.OpenSharedItem($fileName)
    for $olAttach in $msg.Attachments
        If $ExtensionFilter = "*" or StringRight($olAttach.fileName, 3) = $ExtensionFilter Then
            $fileName = $filePath &"\" &$prefix & $olAttach.fileName
            If Not FileExists($fileName) Then
                echo (" "& $fileName&"...")
                $olAttach.SaveAsFile($fileName)
                $msg.Close(1)
                if not FileExists($fileName) Then
                    return false
                endif
            Else
                ConsoleWrite("Warning: File already exists"&@CRLF)
            EndIf
        EndIf
    Next
    return true
EndFunc

 

Link to comment
Share on other sites

Glad you got it working :)
Maybe I'll add some functions to handle shared items in the future.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

@water

I have two for you.

1. I see MS is releasing cloud based Office apps. What is the future of .Net? 

 

2. Have you ever tried to add a button to the Message Inspector?

; https://flylib.com/books/en/2.53.1/working_with_the_inspector_object.html
; Sample VB 

    public partial class ThisApplication
    {
    Office.CommandBarButton btn1;

    private void ThisApplication_Startup(object sender,
    EventArgs e)
    {
    Outlook.MAPIFolder folder = this.Session.GetDefaultFolder(
    Outlook.OlDefaultFolders.olFolderInbox);
    Outlook.Inspector inspector = this.Inspectors.Add(
    folder.Items[1]);
    inspector.Display(missing);

    Office.CommandBar bar = inspector.CommandBars.Add(
    "My Command Bar", missing, missing, true);
    bar.Visible = true;

    btn1 = (Office.CommandBarButton)bar.Controls.Add(
    Office.MsoControlType.msoControlButton,
    missing, missing, missing, true);
    btn1.Click += new
    Office._CommandBarButtonEvents_ClickEventHandler(
    Btn1_Click);
    btn1.Caption = "My Custom Button";
    btn1.Tag = "OutlookAddin1.btn1";
    btn1.Style = Office.MsoButtonStyle.msoButtonCaption;
    }

    void Btn1_Click(Office.CommandBarButton ctrl,
    ref bool cancelDefault)
    {
    MessageBox.Show("You clicked my button!");
    }

    #region VSTO Designer generated code
    private void InternalStartup()
    {
    this.Startup += new System.EventHandler(ThisApplication_Startup);
    }
    #endregion
    }

 

Skysnake

Why is the snake in the sky?

Link to comment
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
 Share

×
×
  • Create New...