Annmv888
asked on
Word if statement for the calendar activex on a docm word 2010 document
I was given (I did not create it) a .docm document with a calendar activex control for Word 2010 so you can click the dropdown and pick a date. On a command button I need to write an if statement so if there isn't a date they get a message stating this is mandatory and they are taken back to the date so they can enter it again...but if there is a date then another form should open.
When I look at the properties of the calendar control the content control properties window opens and there is a Title and Tag both named InvDate. There is also a bookmark with the same InvDate for this date.
I'm at a loss how to do this in Word. I only know a little VBA for Access.
Thanks in advance for any help you can give me.
When I look at the properties of the calendar control the content control properties window opens and there is a Title and Tag both named InvDate. There is also a bookmark with the same InvDate for this date.
I'm at a loss how to do this in Word. I only know a little VBA for Access.
Thanks in advance for any help you can give me.
Hi,
pls try
pls try
Sub macro()
Set cc = ActiveDocument.SelectContentControlsByTitle("invDate").Item(1)
If cc.Range.Text = "Click here to enter a date." Then ' no date
MsgBox "No date"
Else
End If
End Sub
Regards
ASKER
Hi, I couldn't upload the file. I received the following: "The extension of the uploaded file is not in the list of accepted extensions."
I had to send an email to get it added to the file extension list and will be notified once they have added it. Then I will be able to upload the file.
I had to send an email to get it added to the file extension list and will be notified once they have added it. Then I will be able to upload the file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This worked great! Thank you for the help.
Could you send a dummy?
Regards