R
RGFsdG9uX0w
Thank you Ken. I am looking for a solution also, and I see where your answer
is heading. What I am stuck on is how to execute the API functions you
suggested in the Access VBA module. Since the SelectAnmes dialog is modal,
the Access code exectuion stops at the call to .Display.
I'm sure I am overlooking something fairly simple here.
wrote:
> The dialog is modal to Outlook, not to all open windows. That's why you have
> to select Outlook to bring it to the front.
> You would have to get the window handle of that dialog using the
> FindWindow() Win32 API method. Then you'd have to set it to a topmost window
> if you want it in front of all other windows most likely using the
> SetWindowLong() Win32 API call.
> >
>
> "code_monkey_number_9" <code_monkey_number_9
> wrote in message news:F099BE2E-ABCA-4504-84C9-9121593DAF04@microsoft.com...
> > question about using the SelectNamesDialog when automating Outlook 2007
> > from
> > Access 2007: the MSDN Office Developer Center remarks that, for the
> > Display
> > method, "When displaying the Select Names dialog box, Display uses the
> > previous location and size (indicated by the top, left, width, and height)
> > of
> > the dialog box."
> > For me this means that when I display the box, it is consistently hidden
> > behind one or more other open windows. When I call the dialog from my
> > access
> > form, I have to click on the Outlook application (on the start bar) to
> > 'activate' outlook for the dialog to appear.
> > Is there a way to set the dialog's position and/ or focus?
> > Here's how I'm calling the dialog:
> > Dim olApp As Outlook.Application
> > Dim olNS As Outlook.Namespace
> > Dim olDialog As SelectNamesDialog
> > Dim olAddressList As AddressList
> > Dim olRecipient As Outlook.Recipient
> > Dim strTo As String
> > Dim x As Integer
> > Set olApp = CreateObject("Outlook.Application")
> > Set olNS = olApp.GetNamespace("MAPI")
> > Set olDialog = olNS.GetSelectNamesDialog
> > Set olAddressList = olNS.GetGlobalAddressList
> > With olDialog
> > .InitialAddressList = olAddressList
> > .SetDefaultDisplayMode olDefaultMeeting
> > If .Display Then
> > For Each olRecipient In .Recipients
> > x = x + 1
> > strTo = strTo & .Recipients(x) & "; "
> > Next
> > End If
> > End With
> > Me.Text12 = strTo
> > Set olApp = Nothing
> > Set olNS = Nothing
> > Set olDialog = Nothing
> > Set olAddressList = Nothing
>
is heading. What I am stuck on is how to execute the API functions you
suggested in the Access VBA module. Since the SelectAnmes dialog is modal,
the Access code exectuion stops at the call to .Display.
I'm sure I am overlooking something fairly simple here.
wrote:
> The dialog is modal to Outlook, not to all open windows. That's why you have
> to select Outlook to bring it to the front.
> You would have to get the window handle of that dialog using the
> FindWindow() Win32 API method. Then you'd have to set it to a topmost window
> if you want it in front of all other windows most likely using the
> SetWindowLong() Win32 API call.
> >
>
> "code_monkey_number_9" <code_monkey_number_9
> wrote in message news:F099BE2E-ABCA-4504-84C9-9121593DAF04@microsoft.com...
> > question about using the SelectNamesDialog when automating Outlook 2007
> > from
> > Access 2007: the MSDN Office Developer Center remarks that, for the
> > Display
> > method, "When displaying the Select Names dialog box, Display uses the
> > previous location and size (indicated by the top, left, width, and height)
> > of
> > the dialog box."
> > For me this means that when I display the box, it is consistently hidden
> > behind one or more other open windows. When I call the dialog from my
> > access
> > form, I have to click on the Outlook application (on the start bar) to
> > 'activate' outlook for the dialog to appear.
> > Is there a way to set the dialog's position and/ or focus?
> > Here's how I'm calling the dialog:
> > Dim olApp As Outlook.Application
> > Dim olNS As Outlook.Namespace
> > Dim olDialog As SelectNamesDialog
> > Dim olAddressList As AddressList
> > Dim olRecipient As Outlook.Recipient
> > Dim strTo As String
> > Dim x As Integer
> > Set olApp = CreateObject("Outlook.Application")
> > Set olNS = olApp.GetNamespace("MAPI")
> > Set olDialog = olNS.GetSelectNamesDialog
> > Set olAddressList = olNS.GetGlobalAddressList
> > With olDialog
> > .InitialAddressList = olAddressList
> > .SetDefaultDisplayMode olDefaultMeeting
> > If .Display Then
> > For Each olRecipient In .Recipients
> > x = x + 1
> > strTo = strTo & .Recipients(x) & "; "
> > Next
> > End If
> > End With
> > Me.Text12 = strTo
> > Set olApp = Nothing
> > Set olNS = Nothing
> > Set olDialog = Nothing
> > Set olAddressList = Nothing
>