Retrieving information

D

Donteathecheese

I have been assigned to create a form for the company I work for and I have
ran into a few problems with some of the things I want to do. The form I am
creating is a request form, and shippment form.

I wanted the person that was sending the form to be able to go into their
contacts and select a person. After the person has been selected I wanted the
street address, city, state and zip to come into field within the form.

I also wanted the subject box to be autofilled in as fields are inputed.
here is some of my code.
Sub jobName_CustomPropertyChange(ByVal Text)
With Me
Set .jobNumber.text = .jobName.Text
End With
End Sub

This didnt seem to work and I was not sure why.

I also wanted to be able to press a button and send a reply back saying that
the shipment has been taken care of and I was completely lost on this.

If anyone could help me with these things or point me in the right direction
that would be greatly appreicated. Maybe even a book recommendations would be
greatly appreciated.

--Zac
 
E

Eric Legault [MVP - Outlook]

The only way to grab the info from a selected Contact is to grab the
ActiveExplorer.Selection object, ensuring that only one item is selected and
that it is a Contact item. However, the process wouldn't be perfect as the
user would need to click a button on your form to tell your code that they
have effectively chosen the Contact already. You could get fancy with the
Explorer.SelectionChange event, but that could be tricky.

Your procedure stub is incorrect - it should be Sub Item_CustomPropertyChange.

To send a reply, just create a new mail item using
Application.CreateItem(olMailItem), set the properties of the returned object
and call .Send.

For more info on Outlook programming and a great book, see
http://www.outlookcode.com.
 
D

Donteathecheese

I thought that in the Sub Item_CustomPropertyChange syntax you replace Item
with the control you wanted to reference. In my example I wanted the subject
to change when one of the controls to change. Maybe I am a little unclear on
this. I have tried to look up example codes and or forums but I cant seem to
actually get anything that works to look at for examples. Any thoughts would
be great. I think that I might try and get one of the books from the website
you recommended. Just wanted to add thanks for the quick reply.
 
G

Guest

No, that event fires for all custom properties. The name of the property
that caused the event is passed in the Name argument.

Eric
 
D

Donteathecheese

I have tried this and it still didnt seem to work. Not quite sure why

Sub item_CustomPropertyChange(ByVal jobName)
With Me
jobNumber.Text = jobName.Text
End With
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