VBA to populate custom field on custom form


Joined
Mar 22, 2012
Messages
1
Reaction score
0
I've been able to get the following script to create and populate a shared calendar meeting, but I can't seem to figure out how to populate the custom fields on the second page (custom appointment form).

BTW, I'm definately not a programmer, so please go easy on me. Most of the code below was pieced together from different online examples. I've tried to get the custom fields figured out, but to no avail. To keep things simple, I've removed all of my failed attempts from the code below.

Let's say for example, the field that needs to be populated is "Consultant" and the value to enter into that field is "Doug".

Any help would be greatly appreciated.

CODE:
Dim objApp As Outlook.Application
Set objApp = New Outlook.Application
'Copy Clipboard Contents for Body Text
'If not working, make sure "microsoft forms 2.0 library" is setup in tools, references...
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
'Create Appointment in Demo Calendar
Set objFolder = objApp.GetNamespace("Mapi").GetFolderFromID("000000001A447390AA6611CD9BC800AA002FC45A0300A27227F281ECD311A0090004AC4575CD00000000105B0000")
Set objAppt = objFolder.Items.Add
With objAppt
.ReminderSet = False
.MeetingStatus = 1
.AllDayEvent = True
.Body = strClip
.Location = "Onsite Demo"
.Subject = "DK- "
End With
'Open meeting for user to complete
objAppt.Display
Set objApp = Nothing
Set objFolder = Nothing
Set objAppt = Nothing
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top