R
ramudu
Hi,
This is not exactly a mail merge issue but happens when I do the same
so I thought I'd first put my issue here. Our software used to
implement mail merge using a DDE connection between Excel and Word.
Because of problems with Excel (specifically, inability to handle
large amounts of data and Unicode characters) we switched to using an
OleDb connection.
The problem with the OleDb connection is that Word does not
automatically popup and come in front of all the other screens like it
used to with DDE. This (the mail merge) is an important feature of our
software and our clients get queasy (?) when Word doesn't
automatically show up.
I did try to use the ShowWindowAsync, ShowWindow, SetForegroundWindow
methods to try and bring the Word window to the front but this doesn't
seem to help. Here's a snippet of my code below using ShowWindowAsync:
Dim pInstance As Process = _
GetRunningInstance("WINWORD")
If Not pInstance Is Nothing Then
Dim handle As IntPtr = pInstance.Handle
If Not IntPtr.Zero.Equals(handle) Then
Win32Helper.ShowWindowAsync(handle, 2)
Win32Helper.ShowWindowAsync(handle, 9)
End If
End If
Help! Thanks!
- Sri
This is not exactly a mail merge issue but happens when I do the same
so I thought I'd first put my issue here. Our software used to
implement mail merge using a DDE connection between Excel and Word.
Because of problems with Excel (specifically, inability to handle
large amounts of data and Unicode characters) we switched to using an
OleDb connection.
The problem with the OleDb connection is that Word does not
automatically popup and come in front of all the other screens like it
used to with DDE. This (the mail merge) is an important feature of our
software and our clients get queasy (?) when Word doesn't
automatically show up.
I did try to use the ShowWindowAsync, ShowWindow, SetForegroundWindow
methods to try and bring the Word window to the front but this doesn't
seem to help. Here's a snippet of my code below using ShowWindowAsync:
Dim pInstance As Process = _
GetRunningInstance("WINWORD")
If Not pInstance Is Nothing Then
Dim handle As IntPtr = pInstance.Handle
If Not IntPtr.Zero.Equals(handle) Then
Win32Helper.ShowWindowAsync(handle, 2)
Win32Helper.ShowWindowAsync(handle, 9)
End If
End If
Help! Thanks!
- Sri