convert VBA code to Add-in

  • Thread starter bWFzYW5pIHBhcmVzaA
  • Start date Views 5,941
Status
Not open for further replies.
B

bWFzYW5pIHBhcmVzaA

Hi,

I have written simple VBA macro to delete recurrence meetings in

outlook(macro cod is given below). Could any one please tell me what is the

simplest method to convert this macro into Outlook Add-in such that it should

create button on Outlook toolbar and also register itself and start working.

Sub DeleteMeetings()

Dim olkItems As Outlook.Items

Set olkItems = Session.GetDefaultFolder(olFolderCalendar).Items

olkItems.IncludeRecurrences = True

For Each olkAppt In olkItems

olkAppt.Delete

Next

Set olkItems = Nothing

MsgBox "Macro executed successfuly: " & Err

End Sub

Thanks,

Paresh
 
K

Ken Slovak - [MVP - Outlook]

Using what development platform, language and Outlook version?

There is no VBA to addin converter, you first start with whatever platform

and language you want and set up a skeleton addin, then copy in your VBA

code and if necessary translate it into the language you're using.

If you intend to use managed code you will need to somehow shim your addin

so it has its own AppDomain, either using VATO or the COM shim wizard. If

using VB.NET you need to translate the code since VB.NET has many

differences from VBA code (for one thing Long is 64-bit and Integer is

32-bit). VB6 code is much closer to VBA code.

You then need to register your addin and deploy it as well as any

dependencies and prerequisites, such as the Framework for managed code.

"masani paresh" <masanip@deshaw.com> wrote in message

news:8C2E171E-4957-4801-9251-A0E6B3BD924C@microsoft.com...
> Hi,

> I have written simple VBA macro to delete recurrence meetings in
> outlook(macro cod is given below). Could any one please tell me what is
> the
> simplest method to convert this macro into Outlook Add-in such that it
> should
> create button on Outlook toolbar and also register itself and start
> working.

> Sub DeleteMeetings()

> Dim olkItems As Outlook.Items
> Set olkItems = Session.GetDefaultFolder(olFolderCalendar).Items
> olkItems.IncludeRecurrences = True

> For Each olkAppt In olkItems
> olkAppt.Delete
> Next

> Set olkItems = Nothing

> MsgBox "Macro executed successfuly: " & Err

> End Sub

> > Thanks,
> Paresh
 
Status
Not open for further replies.
Top