autofill an outlook form from VB6 form. Link the 2 together

P

pb

vb6 form, com addin OL2002
i have a custom appointment form, that calls a global VB6 form when
necessary. the form has text which i want to autofill the the open
appointment form with. Kinda like selecting a contact from the address book
when composing a new email. i've been trying to set it using New inspector
events, but having no luck. i can hard set a value of the form from the VB6
addin by using:

Public Sub objApptItem_CustomPropertyChange(ByVal Name As String)
objApptItem.UserProperties("sPTID") = "yellow"
End Sub

however, the value isn't determined until the VB6 form is loaded. Any way
to link the vb6 form and appointment form? I was thinking about writing the
values i need from the vb6 form to the registry, and collect those values
from the appointment form, but can't seem to figure it out. Any suggestion
please?
 
P

pb

used this;

used this:

Public Sub TimeStamp()
Dim objOutlook As Outlook.Application
Dim objInspector As Outlook.Inspector
Dim objItem As Object 'Allow any Outlook item type.

Dim strDateTime As String

On Error Resume Next

' Instantiate an Outlook Application object.
Set objOutlook = CreateObject("Outlook.Application")

' The ActiveInspector is the currently open item.
Set objInspector = objOutlook.ActiveInspector

' Check and see if anything is open.
If Not objInspector Is Nothing Then
' Get the current item.
Set objItem = objInspector.CurrentItem

' Get the current date and time.
strDateTime = Now()

objItem.Body = strDateTime & objItem.Body

' To add the date and time stamp to the end of the item,
' comment the preceding code line and uncomment the
' following code line.
objItem.Body = objItem.Body & strDateTime

Else
' Show error message with only the OK button.
MsgBox "No item is open", vbOKOnly
End If

' Set all objects equal to Nothing to destroy them and
' release the memory and resources they take.
Set objOutlook = Nothing
Set objInspector = Nothing
Set objItem = Nothing
End Sub
 

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