Printing labels

G

Guy Cohen

Hi all.

I use VB6+WORD XP.

I wrote something based on : Q258512
http://support.microsoft.com/defaul...port/kb/articles/q258/5/12.asp&NoWebContent=1

In the original sample - MS chose to show the results:
code:
'the mail merge results are displayed
oDoc.Close False
oApp.Visible = True

I want to just print without any user clicks (print, close document).

so I ended my sub like this:

code:
Call WordDoc.PrintOut(False)
Call WordDoc.Close(False)

What I get instead of the content (when I use the original code) is -
A page full with (no values - just headers):
<company> <Company><NextRecord> ...
<Street> <Street> ...
<City> <City> ...
..
..
..

Please advise
TIA
Guy
 
D

Doug Robbins

It would appear that the merge has not actually been executed and that all
you are doing is printing out the mailmerge main document.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
G

Guy Cohen

Hi Doug.
Many thanks for the reply.
Unlike you say - I did the merge (as I wrote - when I use
wordapp.visible=true - I see the document right).
I found my mistake (dont ask me whats good in the result... <newbie>)
Currently I use:

---

Call WordDoc.Close(False)
Call WordApp.PrintOut(True)

---
The change is - I close the doc and print from wordapp.

Its working fine :)

Thanks a lot for trying!

Guy
 
D

Doug Robbins

Previously, it must have been the mailmerge main document that you printed.
It must have been the active document at the time the print command was
issued and the .Close command has closed that so that the result of the
merge has become the active document and is the one that is printed out.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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