PC Review


Reply
Thread Tools Rate Thread

active doc in word - printed via code in access vba

 
 
Gina
Guest
Posts: n/a
 
      6th Mar 2005
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


 
Reply With Quote
 
 
 
 
John Nurick
Guest
Posts: n/a
 
      8th Mar 2005
Hi Gina,

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



On Sun, 6 Mar 2005 12:01:13 +0100, "Gina" <(E-Mail Removed)> wrote:

>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
>


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Reply With Quote
 
Gina
Guest
Posts: n/a
 
      10th Mar 2005
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

"John Nurick" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> Hi Gina,
>
> Assuming you have an object reference to the Word document, all you need
> do is call its PrintOut method.
>
>
>
> On Sun, 6 Mar 2005 12:01:13 +0100, "Gina" <(E-Mail Removed)> wrote:
>
> >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
> >

>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.



 
Reply With Quote
 
Gina
Guest
Posts: n/a
 
      10th Mar 2005
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:d0pgso$95f$04$(E-Mail Removed)...
> 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
>
> "John Nurick" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
> > Hi Gina,
> >
> > Assuming you have an object reference to the Word document, all you need
> > do is call its PrintOut method.
> >
> >
> >
> > On Sun, 6 Mar 2005 12:01:13 +0100, "Gina" <(E-Mail Removed)> wrote:
> >
> > >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
> > >

> >
> > --
> > John Nurick [Microsoft Access MVP]
> >
> > Please respond in the newgroup and not by email.

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2007, Runtime Error code: 429, Active X component can't creat Jey Microsoft Word Document Management 0 12th Jan 2010 09:13 PM
printed emails are not WSIWG. Code is printed vs. the actual text Nik Windows XP Print / Fax 1 17th May 2009 02:23 AM
Access to Active X code names striderwho@gmail.com Microsoft Excel Programming 0 9th Mar 2006 06:17 AM
Capture 'printed output' from Access to inset into Word as Exhibit =?Utf-8?B?UmFscGg=?= Microsoft Word Document Management 3 13th Jul 2005 01:50 PM
How to Access Word active object on other application and Get the word's Document FilePath? Lex Yacc Microsoft C# .NET 0 20th Aug 2003 04:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 PM.