![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: information, retrieving |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Ads |
|
#2
|
|||
|
|||
|
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. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Donteathecheese" wrote: 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 |
|
#3
|
|||
|
|||
|
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. "Eric Legault [MVP - Outlook]" wrote: 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. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Donteathecheese" wrote: 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 |
|
#4
|
|||
|
|||
|
No, that event fires for all custom properties. The name of the property
that caused the event is passed in the Name argument. Eric "Donteathecheese" wrote in message ... 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. "Eric Legault [MVP - Outlook]" wrote: 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. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Donteathecheese" wrote: 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 |
|
#5
|
|||
|
|||
|
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 " wrote: No, that event fires for all custom properties. The name of the property that caused the event is passed in the Name argument. Eric "Donteathecheese" wrote in message ... 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. "Eric Legault [MVP - Outlook]" wrote: 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. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Donteathecheese" wrote: 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 |
|
#6
|
|||
|
|||
|
It doesn't work because jobName is a string variable, not an object. See http://www.outlookcode.com/article.aspx?ID=38 for sample code.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Donteathecheese" wrote in message ... 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 " wrote: No, that event fires for all custom properties. The name of the property that caused the event is passed in the Name argument. Eric "Donteathecheese" wrote in message ... 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. "Eric Legault [MVP - Outlook]" wrote: 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. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Donteathecheese" wrote: 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 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Retrieving sent items | Maurice | Outlook and VBA | 5 | October 9th 07 08:19 PM |
| help with retrieving info | gena | Outlook Express | 6 | June 22nd 07 03:05 PM |
| How could I retrieve free/busy information if the only information I have is the Email address? | Wassim Dagash | Add-ins for Outlook | 1 | January 18th 07 03:19 PM |
| retrieving messages | Janet Lowe | Outlook Express | 1 | October 29th 06 05:25 PM |
| Retrieving information from incomming mail items. | Jan G. Thorstensen | Outlook and VBA | 1 | September 18th 06 05:45 AM |