Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word does not come to the front automatically
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 (?) :P 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 |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word does not come to the front automatically
Just one correction above -
Its not the problem of Excel handling large data but that of DDE. Thanks! - Sri On Mar 28, 11:15 am, "ramudu" wrote: 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 (?) :P 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 |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word does not come to the front automatically
I'm not sure I can help in this case, but
a. how are you invoking Word? b. are you invoking Word Application.Activate at any point? c. are you setting Word Application.Visible = True at any point? Peter Jamieson "ramudu" wrote in message ps.com... 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 (?) :P 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 |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word does not come to the front automatically
Word is invoked by the following code
m_doc = m_wrd.Documents.Open(strDoc) where m_wrd is a reference to Word.ApplicationClass and strDoc is the word document. After the data binding is done to the spreadsheet for which the code is m_doc.MailMerge.OpenDataSource( _ Name:=m_strDsName, _ Connection:="", _ SQLStatement:="SELECT * FROM `Sheet1$`") I activate and set the visible property to true m_doc.Activate() m_wrd.Visible = True Let me know if you need anything else. - Sri On Mar 28, 12:58 pm, "Peter Jamieson" wrote: I'm not sure I can help in this case, but a. how are you invoking Word? b. are you invoking Word Application.Activate at any point? c. are you setting Word Application.Visible = True at any point? Peter Jamieson"ramudu" wrote in message ps.com... 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 (?) :P 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word window popping up in front of other windows | Microsoft Word Help | |||
PIC (ex TROFF/Unix) front end for Word, or via an intermediary? | New Users | |||
Word is adding zeros in front of numbers | Mailmerge | |||
SAVED WORD DOCUMENTS HAVE A ~$ IN FRONT OF THEM AND ARE GREYED OU. | Microsoft Word Help | |||
How do I bring the Word window to front? | Microsoft Word Help |