A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

VBA access to controlelement in a form



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 17th 07, 03:05 PM posted to microsoft.public.outlook.program_vba
Markus Beck
external usenet poster
 
Posts: 2
Default VBA access to controlelement in a form

Hello,
i adapted the form for contact and provided therein a
drop-down control. This drop-down control has given values.
The new Contact-Form is assigned to all contacts. I would
like to access now by VBA (from Word) the drop down element.
I would like to pick the possible values out those the
drop-down control have. I would like to thus access the form
directly. Not on the values the one contact has.
Sorry for my english.


Ads
  #2  
Old July 17th 07, 03:31 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA access to controlelement in a form

See http://www.outlookcode.com/article.aspx?ID=38, the section on unbound controls, for basic control syntax. The List or Column property of the control returns an array of values for the control rows and columns.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Markus Beck" wrote in message ...
Hello,
i adapted the form for contact and provided therein a
drop-down control. This drop-down control has given values.
The new Contact-Form is assigned to all contacts. I would
like to access now by VBA (from Word) the drop down element.
I would like to pick the possible values out those the
drop-down control have. I would like to thus access the form
directly. Not on the values the one contact has.
Sorry for my english.


  #3  
Old July 17th 07, 06:04 PM posted to microsoft.public.outlook.program_vba
Markus Beck
external usenet poster
 
Posts: 2
Default VBA access to controlelement in a form

Hallo Sue,
how do I get a Item(Object) of my "MassageClass"?
How do I receive an object from my Custom form, which the
Contact marked at present has?

[...]
Dim objOutlook As Outlook.Application
Dim objExplorer As Explorer
Dim objContact As ContactItem
Set objOutlook = CreateObject("Outlook.Application")
Set objExplorer = objOutlook.ActiveExplorer
Set objContact = objExplorer.Selection(1)

Set objPage =
objContact.GetInspector.ModifiedFormPages("NameOfP age")
Set objControl = objPage.Controls("NameOfComboBox")
MyValue = objControl.Value
[...]

If I implement this code, I obtain only the present value of
the ComboBox - thus the value that my contact in the field
has. I would like to have however gladly all values of the
ComboBox, which stand in the Custom MassageClass by default
to selection.
I access over VBA to Outlook. I cannot use VB-Script of
examples.


"Sue Mosher [MVP-Outlook]" schrieb
im Newsbeitrag ...
See http://www.outlookcode.com/article.aspx?ID=38, the
section on unbound controls, for basic control syntax. The
List or Column property of the control returns an array of
values for the control rows and columns.



"Markus Beck" wrote in
message ...
Hello,
i adapted the form for contact and provided therein a
drop-down control. This drop-down control has given values.
The new Contact-Form is assigned to all contacts. I would
like to access now by VBA (from Word) the drop down
element.
I would like to pick the possible values out those the
drop-down control have. I would like to thus access the
form
directly. Not on the values the one contact has.
Sorry for my english.




  #4  
Old July 17th 07, 07:22 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA access to controlelement in a form

Repeating what I said earlier: The List or Column property of the [combo box] control returns an array of values for the control rows and columns.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Markus Beck" wrote in message ...
Hallo Sue,
how do I get a Item(Object) of my "MassageClass"?
How do I receive an object from my Custom form, which the
Contact marked at present has?

[...]
Dim objOutlook As Outlook.Application
Dim objExplorer As Explorer
Dim objContact As ContactItem
Set objOutlook = CreateObject("Outlook.Application")
Set objExplorer = objOutlook.ActiveExplorer
Set objContact = objExplorer.Selection(1)

Set objPage =
objContact.GetInspector.ModifiedFormPages("NameOfP age")
Set objControl = objPage.Controls("NameOfComboBox")
MyValue = objControl.Value
[...]

If I implement this code, I obtain only the present value of
the ComboBox - thus the value that my contact in the field
has. I would like to have however gladly all values of the
ComboBox, which stand in the Custom MassageClass by default
to selection.
I access over VBA to Outlook. I cannot use VB-Script of
examples.


"Sue Mosher [MVP-Outlook]" schrieb
im Newsbeitrag ...
See http://www.outlookcode.com/article.aspx?ID=38, the
section on unbound controls, for basic control syntax. The
List or Column property of the control returns an array of
values for the control rows and columns.



"Markus Beck" wrote in
message ...
Hello,
i adapted the form for contact and provided therein a
drop-down control. This drop-down control has given values.
The new Contact-Form is assigned to all contacts. I would
like to access now by VBA (from Word) the drop down
element.
I would like to pick the possible values out those the
drop-down control have. I would like to thus access the
form
directly. Not on the values the one contact has.
Sorry for my english.




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Form that can be stored for Access PJFry Outlook - Using Forms 4 July 10th 07 08:44 PM
form data in outlook web access JP Outlook - Using Forms 2 May 11th 07 07:03 AM
Using Access to design a form and then publish it djb Outlook - General Queries 3 September 14th 06 06:22 PM
import access database in my own contacts form Else Outlook - Using Forms 2 June 12th 06 10:35 PM
Link the MS Access form to the Outlook Jacky Outlook - Using Forms 1 March 31st 06 04:52 PM


All times are GMT +1. The time now is 06:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.