List Info

Thread: Re: Book & MS Word doc printing




Re: Book & MS Word doc printing
country flaguser name
United States
2007-05-27 02:17:45

Soo
let me try a loop counter that goes no where ?
 
thanks
dwight
----- Original Message -----
Sent: Saturday, May 26, 2007 6:47 AM
Subject: Re: [helpwithvb] Book & MS Word doc printing

I believe that the main problem is because of the Close being processed too quickly.


Dwight Norris wrote:
domain.invalid" type="cite">

Tim first of all thanks for the code I would have been months working this out
I am working at understanding the code and what does what as we speak
 
The error is a process issue or lets say it has more to do with what buttons you press
 
1st I did a PRINT and the message says Word is printing do you wish to cancel YES or NO
I pick YES all is fine
 
2nd I did a VIEW all works ok
 
3rd I did a PRINT and selected NO all works ok
 
4th I did a PRINT and selected YES
this is where NORMAL.dot template is created
I selected to not save this template
then the document prints
 
then VIEW or PRINT tells me that a file is busy
 
"The file is in use by another application or user
CWindows....TemplatesNormal.dot"
 
This process is a little slow but I am not sure if that is my system or the amount of
resource being used in the back ground
 
dwight
----- Original Message -----
Sent: Thursday, May 24, 2007 3:53 PM
Subject: Re: [helpwithvb] Book & MS Word doc printing

Dwight, would you mind posting the error message?  I love challenges.

Tim

Dwight Norris wrote:
domain.invalid" type="cite">

Steve is correct and so is Tim
Tim's code permits the USER to view the document with no option to alter the
document
BUT it also creates a template and an odd error message
I can try to work out this bug
the PRINT function works great
and I am sure I can load the list box from an Access db file

Tim thanks a ton for the code
now I and others have a very powerful working model of how to print MS Word
documents
from Visual Basic

dwight
----- Original Message -----
From: "Steve Manser" < smanser%40twcny.rr.com">smansertwcny.rr.com>
To: < helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com>
Sent: Monday, May 14, 2007 12:32 PM
Subject: RE: [helpwithvb] Book & MS Word doc printing

>
> Hi,
>
&gt; Just a thought, but I don't think Dwight wants
> to present the User with a real 'print preview'
&gt; but instead he only needs to allow the User(s)
&gt; to see a display of the 'Read-Only' Word document.
>
> In fact, he doesn't really need to display a real
> Word Document, just the correct information, perhaps
&gt; in a Flexgrid control, or set of controls, but then
> allow them to print-out a copy of the Word Document.
>
> In Dwight's situation the normal 'User' or Viewer,
&gt; should not be allowed to make changes to the final
> Word document.
>
> So there seems to be no need for the Print Preview
&gt; except when the document is being prepared in Word,
> by the management staff members.
&gt;
> Most of the time Users will be viewing the document
&gt; and will not be printing the document every time
> it is being viewed, by the User(s).
&gt;
> I think Dwight still wants the Viewer/User
> to have the option to Print Out a copy of the
> Word Document in case they are off-site, and
> need a hard copy for a reference.
>
> So Dwight does need to provide a means for the User
> to navigate to where the original document(s)
> ( Read Only ) are being stored, and then to
> print-out the document they need in hand.
>
> Also, since there are documents residing in a folder,
&gt; somewhere, Dwight needs to obtain those file names
> so that they can be listed in the List Box control.
&gt;
> Does that sound about right, Dwight ?
>
>; Steve
>
> ________________________________________
> From: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
>; [mailto: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com]
&gt; On Behalf Of twlewis%40softhome.net">twlewissofthome.net
> Sent: Monday, May 14, 2007 10:33 AM
> To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
>; Subject: Re: [helpwithvb] Book & MS Word doc printing
&gt;
> Dwight, look at the code below and see if something like this will work
> for you. The form has a list box called lstDocument, and two buttons
&gt; called cmdPreview and cmd Print. The code was sort of on the fly, but it
> works. It is VB6 with a reference to the MS Word 11.0 object library
&gt; (Project ->References)
> You probably already know this, but some ask why the need to quit Word and
> set the objects to nothing. If the code is stopped without quitting Word
> and setting the Word objects to nothing, an instance of winword is still
> running, and can cause sluggishness. The instance would then have to be
> lcosed through the task manager.
&gt;
> Private Sub cmdPreview_Click()
&gt; Dim strDocument As String
>; strDocument = lstDocument.Text
>; Process "Preview", strDocument
> End Sub
>
&gt; Private Sub cmdPrint_Click()
>; Dim strDocument As String
>; strDocument = lstDocument.Text
>; Process "Print", strDocument
> End Sub
>
&gt; Private Sub Form_Load()
> lstDocument.AddItem "C:My test document.doc"
> lstDocument.AddItem "C:Dog and cats.doc"
> End Sub
> Private Sub Process(ProcessType, strDocument)
> Dim oWord As Word.Application
> Dim oDoc As Word.Document
> If strDocument = "" Then
> MsgBox "Please select a document"
> Else
> Set oWord = New Word.Application
> oWord.Documents.Open FileName:=strDocument, ReadOnly:=True
> Set oDoc = oWord.ActiveDocument
> Select Case ProcessType
> Case "Preview"
> oWord.Visible = True
> oDoc.PrintPreview
>; While oWord.PrintPreview = True
> Wend
> Case "Print"
&gt; oWord.Visible = False
> oDoc.PrintOut
> End Select
>; oDoc.Close
> oWord.Quit
> Set oDoc = Nothing
&gt; Set oWord = Nothing
&gt; End If
> End Sub
>
&gt; > Adelle
>; > thanks for asking
>; > after the document is selected from a list box....
&gt; >
> > I am still thinking about how to list these in the list box
> > seems easy if I remember correctly
> >
> > ....I would like the user to have the option to
> > View the document (with no options to change the doc)
> > and to Print after viewing ( the document )
> > or
> > Print after selection with no Viewing
&gt; > (and no change to the doc permitted)
> >
> > From time to time these documents will be edited
>; > but with word and never by the end user
> > only (edited by) a select group of managers
&gt; >
> > Dwight
>; >
> >
> > ----- Original Message -----
> > From: "Adelle Hartley" < adelle%40bullet.net.au">adellebullet.net.au>
&gt; > To: < helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com>
> > Sent: Sunday, May 13, 2007 12:03 AM
> > Subject: RE: [helpwithvb] Book & MS Word doc printing
&gt; >
> >
> >> Hi Dwight,
&gt; >>
&gt; >> > I am still struggling with printing and
> >> > viewing MS Word documents from VB 6
> >>
&gt; >> Do you need to "print-preview" the document, or just print it ?
> >> And do you need to manipulate the document or
> >> just print it from a file, "as-is" ?
> >>
&gt; >> Adelle.
&gt; >>
&gt;
>
&gt;
>
>; Yahoo! Groups Links
>
>
>
>
>



__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )