Solved

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

Posted on 2010-08-20
3
1,945 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
SylvainDrapeau earned 500 total points
ID: 33490352
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
ID: 33491439
I did not test the code. But you gave me the answer I needed.

Thanks!
0
 
LVL 8

Expert Comment

by:SylvainDrapeau
ID: 33491490
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

739 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