Results 1 to 5 of 5

Thread: How do I use the progress bar with a message box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I would like to use a msgbox with a progress bar or a form like a msg box with a progress bar. I need this to work after printing a document using code I need to close Word after the document has printed.

    Does anyone have any example code they could share?

    Thank You!!!

    Help!!!

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I'm not clear exactly what you're trying to do/ what the problem is, could you be more specific

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I call Word and a specific document from my program and populate it with fields and text. I then need to print automatically and close Word and go back to program. When I try to close Word, I have a problem it says closing Word will cause documents not to print, etc. I thought maybe using a progress bar would help; any idea would be helpful!!!

    Thanks

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I'm sorry when I close Word using code right after the auto print; here's the code:

    If cboLetter = "L" Then
    Dim obj As New Word.Application
    obj.WindowState = wdWindowStateMaximize
    obj.Visible = True
    obj.Documents.Open ("G:\WORD\TEMPLATE\Ombudsman\FSD.dot")
    obj.ActiveDocument.Select
    With Selection.ParagraphFormat
    .LeftIndent = InchesToPoints(0)
    .RightIndent = InchesToPoints(0)
    .SpaceBefore = 0
    .SpaceBeforeAuto = False
    .SpaceAfter = 0
    .SpaceAfterAuto = False
    .LineSpacingRule = wdLineSpaceSingle
    .Alignment = wdAlignParagraphJustify
    .WidowControl = True
    .KeepWithNext = False
    .KeepTogether = False
    .PageBreakBefore = False
    .NoLineNumber = False
    .Hyphenation = True
    .FirstLineIndent = InchesToPoints(0)
    .OutlineLevel = wdOutlineLevelBodyText
    .CharacterUnitLeftIndent = 0
    .CharacterUnitRightIndent = 0
    .CharacterUnitFirstLineIndent = 0
    .LineUnitBefore = 0
    .LineUnitAfter = 0
    End With

    With Selection.Font
    .Name = "Arial"
    .Size = 11
    .Bold = False
    .Italic = False
    .Underline = wdUnderlineNone
    .UnderlineColor = wdColorAutomatic
    .StrikeThrough = False
    .DoubleStrikeThrough = False
    .Outline = False
    .Emboss = False
    .Shadow = False
    .Hidden = False
    .SmallCaps = False
    .AllCaps = False
    .Color = wdColorAutomatic
    .Engrave = False
    .Superscript = False
    .Subscript = False
    .Spacing = 0
    .Scaling = 100
    .Position = 0
    .Kerning = 0
    .Animation = wdAnimationNone
    End With
    obj.Selection.InsertDateTime DateTimeFormat:="MMMM d, yyyy", InsertAsField:= _
    False, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
    InsertAsFullWidth:=False
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeText txtFirstName & " " & txtLastName
    obj.Selection.TypeParagraph
    obj.Selection.TypeText txtAddress1
    obj.Selection.TypeParagraph
    obj.Selection.TypeText txtCity & ", " & txtState & " " & txtZip
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    obj.Selection.TypeText "Re:" & " " & cboNo
    obj.Selection.TypeParagraph
    obj.Selection.TypeText "Response No.:" & " " & txtAutoResponse
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
    obj.Selection.TypeText "Dear" & " " & txtFirstName & " " & txtLastName
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
    obj.Selection.TypeText "I have received your letter complaint dated" & " " & txtDateOpened & "." & _
    "Your letter has been forwarded to the attention of a Public Service Representative for investigation and response."
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
    obj.Selection.TypeText "Please be assured that the issues you raised in your letter will be fully investigated. Also, that you will receive a written reply within 30 days of the receipt of this letter."
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeText "Very Truly Yours,"
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeParagraph
    obj.Selection.TypeText "John Doe"
    obj.Selection.TypeParagraph
    obj.Selection.TypeText "Assistant Director, of Nothin"
    obj.ActiveDocument.PrintOut
    Close all open Word documents and exit Word
    obj.Documents.Close wdDoNotSaveChanges
    'obj.Application.Quit
    End If



  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Sorry, not my area, can you keep word minmized and use GetPrinterData to get the queue, I've never used it or anything you might find some help in MSDN.
    If it wasn't for this sentence I wouldn't have a signature at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width