Mail Merge

G

Guest

Have cracked Albert D. Kallal's Mail Merge, and hats off to you it works a
treat.
Have one problem, added a button to my main form to open the Word Templates
Form and it all works a treat untill I close Word then cancel the Word
Templates Form. Now I find all my forms have closed.
It is important to retain the main form.
Any Ideas?
Cheers Ross
 
A

Albert D. Kallal

Have cracked Albert D. Kallal's Mail Merge, and hats off to you it works a
treat.
Have one problem, added a button to my main form to open the Word
Templates
Form and it all works a treat untill I close Word then cancel the Word
Templates Form. Now I find all my forms have closed.
It is important to retain the main form.
Any Ideas?
Cheers Ross

There is nothing special about those forms. I mean, close any form..and the
other forms should not close....

I mean, in place of my template form, put a form that says "hello". closing
that form, or my form should not cause any specify behaviours to other forms
opened. I would perhaps check your code for errors (does all of the code
compile?)..
 
G

Guest

Hi Albert

Yep have checked code - compiles ok. also placed a detail confirmation form
between my main form and your forms, but still having the problem - It is
only my main form that is affected and it occurs just as word is loading.
Also word does not load in maximised form is that correct? can it me easey
changed?
Any Ideas?
Ross
 
G

Guest

Hi Albert
Forgot to mention - problem doesn't occur when modifying template only when
merging the data.
Cheers Ross
 
A

Albert D. Kallal

Hum, only two things I can think of is that for some reason you have a forms
popup value set = yes (but, then
my form would not display).

Hum, perhaps you have a timer function running in another form?

I would re-boot the computer...and try a test with my sample.

Does the sample download exhibit the same behaviour ? (ie: when you merge,
the word document does not display, but remains minimized??).

Try both closing just the document..and test...

Also, try a test where you complate close word each time......

Hum, this is strange indeed......what version of office?
 
G

Guest

Hi Albert
Tried all you suggest - no popups set accept your GuiWordTemplate Form, have
no timer function, have tested your sample again and note that you close the
GuiWordTemplate Form when Word Merges, on my progam your GuiWordTemplate Form
remains open and my main form closes. Word still opens like a popup and not
full screen.
Using Office Pro 2003
Have managed to get it to work where it closes my Confirmation Form and not
the Main form but it leaves the Main Form in a reduced window and leaves your
GuiWordTemplate form on top. I can close this and maximise the Main form. It
works but looks a little messy.
Any Ideas?
Ross
 
G

Guest

Ross said:
Hi Albert
Tried all you suggest - no popups set accept your GuiWordTemplate Form, have
no timer function, have tested your sample again and note that you close the
GuiWordTemplate Form when Word Merges, on my progam your GuiWordTemplate Form
remains open and my main form closes. Word still opens like a popup and not
full screen.
Using Office Pro 2003
Have managed to get it to work where it closes my Confirmation Form and not
the Main form but it leaves the Main Form in a reduced window and leaves your
GuiWordTemplate form on top. I can close this and maximise the Main form. It
works but looks a little messy.
Any Ideas?
Ross
 
G

Guest

Hi Albert
Sussed the problem
Cause I have the main form on Maximised, your form was loading the sameway,
therefore I had it set to popup. Once I take the Maximised off and the popup
on your form it works a treat.
Any ideas how to have the same effect so I can set the main form back to
Maximised?
Think your Mail Merge program is a cracker.
Cheers Ross
 
A

Albert D. Kallal

have tested your sample again and note that you close the
GuiWordTemplate Form when Word Merges

The above is correct. If you merge, then the form is closed.
, on my progam your GuiWordTemplate Form
remains open and my main form closes.

Hum, yes, as mentioned, perhaps you are opening your form as dialog?
(check this).
Word still opens like a popup and not
full screen.

Yes, that is correct. Word should open up to the last size YOU used!!! .So,
simply re-size word as you please...perhaps almost full screen size would be
good. This just respects how the user previous had word sized, and I don't
mess with this to piss off users. So, size word to what you like. Next time
it lauches..it should appear as that size.
Using Office Pro 2003
Have managed to get it to work where it closes my Confirmation Form and
not

What conformaton form? When does that launch? I assumign for right now, we
are using the smaple download, or you have a form in your appciton, and you
palced ONE LINE of code behind the buttion

MergeSingleWord

The above command is going to launch that word prompt form of mine...and you
likey don't want to change the focus after/during this process.

Test the above with the sample, or yours untill this works. If your app
don't work, then go back to testing/playing with the smaple downlaod untill
that works.

It does seem that the sample works as it should. Try re-sizing word...and
then close/save the document...

I would have to assume that my sample does launch word, and word has the
focus.

If the sample down works correct (and you seem to hint that it does), then I
have to assume that perhaps after you execute mergesingle word, you are
running other code. Remember, my merge code has to pick up fields from the
form that had the focus when my code launches (as you don't even has to pass
my routines any data!!!).

So, check the sample again, but it seems to be running correct. (when you
merge, I close my prompt form...if you edit a template, then it stays open,
as you
a) likely want to edit more templates
or
b) want to test merge the document you just edited...

So, assuming the sample download does/is working correctly, is there any
other code you execute when you do a MergeSingle word?

That sample is downloaded zillions of times, and there is generally not a
problem such as yours. Something else is very wrong here...I just don't know
what.

If the sample don't work, then there is LITTLE use trying to get it to work
in your existing application.

Simply play with, and get the sample download (unmodified) working first.
Once that seems to work, then you can go back to the process of trying to
use it in your code. If the sample don't work on your machine, it is a
exercise in futility to skip on this, and then try to make it work in your
code/existing applications.

We have to get the un-modified download sample to work on your machine,
since that is the one that works on 1000's of other machines as is....
 
A

Albert D. Kallal

Hi Albert
Sussed the problem
Cause I have the main form on Maximised, your form was loading the
sameway,
therefore I had it set to popup. Once I take the Maximised off and the
popup
on your form it works a treat.
Any ideas how to have the same effect so I can set the main form back to
Maximised?
Think your Mail Merge program is a cracker.

Ah...ok!! (you can seem other post....as I was perplxed!!!).

Ok, all you have to do is change one line of code.....

In the code behind the "ok -merge to word" buttion, in form GuiWordTemplate
simply change:

Call RidesMergeWord(strDirPath & Me.lstFiles & ".doc", strDirPath,
strOutDocName)
DoCmd.Close

to

Call RidesMergeWord(strDirPath & Me.lstFiles & ".doc", strDirPath,
strOutDocName)
DoCmd.Close acForm, Me.Name <==== here

Only the 2nd line need be changed. I pasted 2 lines of code as above just to
you can see/find the correct place..

Normally, today, I almost *always* use

DoCmd.Close acForm, Me.Name

The reason why the above is better then

DoCmd.Close

Is because if there is ANY focus problem, the close command is consumed by
the form that has the focus!!!

So, put the form's setting back to popup, and change the one line of code.

In fact, I will incorporate your fix into the download...

Thanks for sticking it out!! - you can ignore my other post..but, I simply
had suggested that you try and get the sample download to work first...
 
G

Guest

Hi Albert
Thats cracked it.
All works a treat now. Thanks very much - looks very professional.
Have you any suggestions re linking to email?
Cheers Ross
 
A

Albert D. Kallal

Hi Albert
Thats cracked it.
All works a treat now. Thanks very much - looks very professional.
Have you any suggestions re linking to email?
Cheers Ross

Right on....

Ok...email? I am actually planning a version that works exactly the same as
word merge, but in place of merging to word, it merges to outlook, and would
even allow "fields" in the email.....

But, as of now, I don't have that solution made just yet....
 
G

Guest

Cheers Albert
Will keep checking your site.
Ross

Albert D. Kallal said:
Right on....

Ok...email? I am actually planning a version that works exactly the same as
word merge, but in place of merging to word, it merges to outlook, and would
even allow "fields" in the email.....

But, as of now, I don't have that solution made just yet....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top