DMTechGrooup
asked on
OUTLOOK MACRO - VBA - INPUTBOX - MINI CALENDAR
I have been helped by many here and I truly appreciate it. As I get new ideas.. I come here for guidance..
I have an outlook macro that asks a bunch of questions then generates a calendar event and opens MS word and fills in a template..
What I want to know know is the first question it asks is date.. and the user has to enter something like 2/27 for February 27th.. instead of that is there some type of mini calendar they can use to select the date? Either and example or link is greatly appreciated.
I have an outlook macro that asks a bunch of questions then generates a calendar event and opens MS word and fills in a template..
What I want to know know is the first question it asks is date.. and the user has to enter something like 2/27 for February 27th.. instead of that is there some type of mini calendar they can use to select the date? Either and example or link is greatly appreciated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help.. I am very rusty as VB..
I added the OK button.. but I cant figure out what to put in the OnClick properties..
I googles around and nothing has worked.
I added the OK button.. but I cant figure out what to put in the OnClick properties..
I googles around and nothing has worked.
Private Sub OK_Click()
vbOK
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very helpful, Thanks for your time and help it works great! I am sure I will be asking new stuff in the future and hope I can get your help! Thanks again.
Glad to have helped. :-)
@DMTechGrooup:
I forgot to mention that if you've used the form's Tag and the function, as I described above, you will need to handle the eventuality of a user closing the form using its close button (x) rather than the OK button (you know that if a user can do something the wrong way they probably will). As things stand it will unload the form and cause the function to error. The workaround is easy though, just add this code to your user form:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True 'Prevents the form unloading so its Tag property can still be read
Me.Tag = "Cancel"
Me.Hide
End Sub
Or, if you don't want to give users an option to cancel, do something like this instead:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Cancel = True
MsgBox "Select a date and click OK.", vbExclamation, "Not Allowed!"
End Sub
I forgot to mention that if you've used the form's Tag and the function, as I described above, you will need to handle the eventuality of a user closing the form using its close button (x) rather than the OK button (you know that if a user can do something the wrong way they probably will). As things stand it will unload the form and cause the function to error. The workaround is easy though, just add this code to your user form:
Private Sub UserForm_QueryClose(Cancel
Cancel = True 'Prevents the form unloading so its Tag property can still be read
Me.Tag = "Cancel"
Me.Hide
End Sub
Or, if you don't want to give users an option to cancel, do something like this instead:
Private Sub UserForm_QueryClose(Cancel
Cancel = True
MsgBox "Select a date and click OK.", vbExclamation, "Not Allowed!"
End Sub
Oops.. that UserForm code block should have this line at the top:
If CloseMode > 0 Then Exit Sub
Otherwise it will still execute when it is closed legitimately from the function.
If CloseMode > 0 Then Exit Sub
Otherwise it will still execute when it is closed legitimately from the function.
ASKER
Thanks!
ASKER
Here is the begining of the macro as it is cycling through the questions.
Open in new window