active doc in word - printed via code in access vba

  • Thread starter Thread starter Gina
  • Start date Start date
G

Gina

Hi all.

my tool writes recordsets to a word document table

for now the word document is visible - when I am ready with my tool I intend
to set the visible property to false
but then I should have a command telling word that it should print the
document just completed twice

for now it doesn't even print at all.
it just opens up I can see all my various data stuff put on the right place
but have to go to word and use the menue to print

can I automate this ??? - how ???

Thanks for your time & help in advance,
Gina
 
Hi Gina,

Assuming you have an object reference to the Word document, all you need
do is call its PrintOut method.
 
John.

Thanks,
I found out when I call the save method it works as well.
But then I would have to save all these docs which are no longer needed
after a user has done some amendments to it and of course printed it out how
many copies the user decides.
I just want to let the user do whatever he wants in an open word environment
and the current document visible in word created by my vba tool .

that seems to cause a problem for some strange reason

Gina
 
Hi all.

Thanks to JaRa's example code, I changed it a bit and created a ref to New
Word.Application

Set DC = GetObject(wrd.ActiveDocument)

set it later on to wrd.quit
set wrd = Nothing

all works .... now I can go shopping ;-))

Thanks guys!!!!! for all your help and for your time!!

Gina

Gina said:
John.

Thanks,
I found out when I call the save method it works as well.
But then I would have to save all these docs which are no longer needed
after a user has done some amendments to it and of course printed it out how
many copies the user decides.
I just want to let the user do whatever he wants in an open word environment
and the current document visible in word created by my vba tool .

that seems to cause a problem for some strange reason

Gina
 
Back
Top