Solved

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

Posted on 2010-08-20
3
1,919 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
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

756 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