×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Force Window to Open on Top

Force Window to Open on Top

Force Window to Open on Top

(OP)
I have a VBA code in excel to bring up the GAL (Global Address List) from Outlook, through word since excel doesn't have the functionality.

The problem is that the GAL window is opening below the excel window. It is causing problems for users with a single monitor setup, because it locks out the excel page, and they cant get to the GAL window. I think the problem may be due to the fact that outlook is already running, so it is opening on the same plane as outlook, which may be underneath the excel spreadsheet.

Is there a way to make the GAL window open on top?

Private Sub CommandButton1_Click()

Dim objWordApp As Object
Dim strCode As String
Dim strAddress As String
Dim lngDoubleCR As Long
'Set up the formatting codes in strCode
strCode = "<PR_DISPLAY_NAME>"

' As GetAddress is not available in MS Excel, a call to MS Word object
' has been made to borrow MS Word's functionality
Application.DisplayAlerts = False
'On Error Resume Next
' Set objWordApp = New Word.Application
Set objWordApp = CreateObject("Word.Application")
strAddress = objWordApp.GetAddress(, strCode, False, 1, , , True, True)
objWordApp.Quit
Set objWordApp = Nothing
On Error GoTo 0
Application.DisplayAlerts = True

' Nothing was selected
If strAddress = "" Then Exit Sub

strAddress = Right(strAddress, Len(strAddress))

'Eliminate blank paragraphs by looking for two carriage returns in a row
lngDoubleCR = InStr(strAddress, vbNewLine & vbNewLine)
Do While lngDoubleCR <> 0
strAddress = Left(strAddress, lngDoubleCR - 1) & Mid(strAddress, lngDoubleCR + 1)
lngDoubleCR = InStr(strAddress, vbNewLine & vbNewLine)
Loop

TextBox1.Text = strAddress

End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources