Solved

Outlook VBA macro - Set appointment item to "show time as tentative"

Posted on 2010-08-20
3
1,843 Views
Last Modified: 2013-12-19
Help please -
I need an Outlook (2007) VBA macro - Set appointment item to "show time as tentative"
When I am in the "explorer view " of my calendar I would like to click a macro whih will set the selected item(s) to "tentative"

Thanks!
Jim
0
Comment
Question by:JWK801
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
SylvainDrapeau earned 500 total points
Comment Utility
Hello !

Assign "MakeTentative" to a new button and test if this does the trick.

I did not test it but I'm pretty sure it will work. Just for caution, create a new calendar and test there before testing in your real calendar.

If it does not work, write back with the error and line number.

I can only test it on Monday, if you don't mind waiting.

Syldra
Sub MakeTentative()



Dim objItem As Object



Set objItem = GetCurrentItem()



If Not TypeOf objItem Is AppointmentItem Then

    MsgBox ("Not an appointment")

    Exit Sub

End If



Set objItem.BusyStatus = 1

objItem.Save



End Sub



Function GetCurrentItem() As Object

Dim objApp As Outlook.Application

Set objApp = Application

On Error Resume Next

Select Case TypeName(objApp.ActiveWindow)

    Case "Explorer"

        Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)

    Case "Inspector"

        Set GetCurrentItem = objApp.ActiveInspector.CurrentItem

    Case Else

End Select

End Function

Open in new window

0
 

Author Closing Comment

by:JWK801
Comment Utility
I did not test the code. But you gave me the answer I needed.

Thanks!
0
 
LVL 8

Expert Comment

by:SylvainDrapeau
Comment Utility
Great, thank you !

If there's an error with the code, I can still help you. It would be better to have a 100% working solution in case someone with no VBA knowledge needs it later.

Syldra
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now