Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-12-2021, 05:15 AM
scadaman29325 scadaman29325 is offline appt that occurs every year for 1hr per day for 10 days Windows 10 appt that occurs every year for 1hr per day for 10 days Office 2016
Novice
appt that occurs every year for 1hr per day for 10 days
 
Join Date: Sep 2010
Posts: 5
scadaman29325 is on a distinguished road
Default appt that occurs every year for 1hr per day for 10 days


I have an appt every year, for 10 days, that only last an hour.

I can do 1 appt for all day for 10 days every year, but I would like for it to show just 1 hour.

In the past I would make 10 appts that occur every year. Just wondering if there is already a way to do it?

Thanks
Reply With Quote
  #2  
Old 07-12-2021, 09:55 PM
gmayor's Avatar
gmayor gmayor is offline appt that occurs every year for 1hr per day for 10 days Windows 10 appt that occurs every year for 1hr per day for 10 days Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I don't believe that is possible - stick with the 10 appointments. If the occur on the same day each year make them repeating. Otherwise enter the start date and start time of the appointment in the following macro when prompted and it will create 10 appointments:
Code:
Sub CreateTenAppts()
Dim i As Integer
Dim vDate As Variant
Dim sDate As String, sTime As String
Const sSubject As String = "Strategy Meeting" 'appointment subject
Const sLocation As String = "Conference Room" 'appointment location
Const sBody As String = "" 'The body text of the appointment
Const lMinutes As Integer = 60 'the length in minutes of the appointment

    sDate = InputBox("Enter start date 'mm/dd/yyyy' :")
    vDate = Split(sDate, "/")
    sTime = InputBox("Enter start time 'hh:mm' :")
    For i = 0 To 9
        sDate = CStr(vDate(0)) & "/" & CStr(Val(vDate(1) + i)) & "/" & CStr(vDate(2))
        CreateAppointment sSubject, sLocation, sBody, sDate, sTime, lMinutes, False
    Next i
lbl_Exit:
    Exit Sub
End Sub


Private Sub CreateAppointment(strSubject As String, _
                              strLocation As String, _
                              strBodyText As String, _
                              strDate As String, _
                              strTime As String, _
                              Optional iMinutes As Integer, _
                              Optional bAllDay As Boolean = True, _
                              Optional strName1 As String, _
                              Optional strName2 As String, _
                              Optional lngStatus As Long = olNonMeeting)

Dim olItem As AppointmentItem
Dim rRequiredAttendee As Recipient
Dim rOptionalAttendee As Recipient
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object

    Set olItem = CreateItem(olAppointmentItem)
    With olItem
        .MeetingStatus = lngStatus
        .Subject = strSubject
        .Location = strLocation
        .Start = strDate & Chr(32) & strTime        ' & strAMPM
        .Duration = iMinutes
        .AllDayEvent = bAllDay
        'Set rRequiredAttendee = .Recipients.Add(strName1)
        'rRequiredAttendee.Type = olRequired
        'Set rOptionalAttendee = .Recipients.Add(strName2)
        'rOptionalAttendee.Type = olOptional
        .Display
        Set olInsp = .GetInspector
        Set wdDoc = olInsp.WordEditor
        Set oRng = wdDoc.Range
        oRng.Text = strBodyText
    End With
    olItem.Close olSave
    Set olItem = Nothing
    Set rRequiredAttendee = Nothing
    Set rOptionalAttendee = Nothing
    Set olInsp = Nothing
    Set wdDoc = Nothing
    Set oRng = Nothing
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-13-2021, 04:58 AM
scadaman29325 scadaman29325 is offline appt that occurs every year for 1hr per day for 10 days Windows 10 appt that occurs every year for 1hr per day for 10 days Office 2016
Novice
appt that occurs every year for 1hr per day for 10 days
 
Join Date: Sep 2010
Posts: 5
scadaman29325 is on a distinguished road
Default

Thanks, Phil.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
appt that occurs every year for 1hr per day for 10 days How can I count per year and per week the total number of times a code occurs Stefan_Deckers Excel 3 09-19-2020 02:36 PM
appt that occurs every year for 1hr per day for 10 days Creating a formula that will determine if a code type occurs within 90 days of anotherspecific type wheddingsjr Excel 7 10-16-2018 12:13 PM
converting a return of days in a formula to year 1, 2, 3 ect. bonth123 Excel 4 06-09-2017 07:00 AM
How to search for a specific year from a table with year range? Wii Excel 0 05-05-2015 12:40 PM
How to calculate a rolling year-to-date percentage by quarter as the year progresses sleake Excel Programming 2 04-23-2015 11:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft