Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ramudu ramudu is offline
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ramudu ramudu is offline
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ramudu ramudu is offline
external usenet poster
 
Posts: 13
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word window popping up in front of other windows Dave Microsoft Word Help 0 January 24th 07 03:16 PM
PIC (ex TROFF/Unix) front end for Word, or via an intermediary? Bill Davy New Users 0 January 12th 06 04:56 PM
Word is adding zeros in front of numbers Nat Mailmerge 6 July 22nd 05 01:12 PM
SAVED WORD DOCUMENTS HAVE A ~$ IN FRONT OF THEM AND ARE GREYED OU. toonei Microsoft Word Help 4 December 16th 04 04:39 AM
How do I bring the Word window to front? bh Microsoft Word Help 2 December 14th 04 06:09 PM


All times are GMT +1. The time now is 05:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"