Results 1 to 11 of 11

Thread: Word formatting problems -TabStops & TypeText

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Word formatting problems -TabStops & TypeText

    An existing VB6 app uses Word automation to create/print reports. The posted code is a small snippet of the whole process but the majority of the code uses the these same Word methods/properties.

    The first 3 lines of the attached picture are what normally gets created/printed. The bottom 3 lines are what is happening to 1 user but not all the time. The TypeText method is printing all the text in the same position. Sometimes closing/opening the app solves the problem but in some cases a re-boot is necessary.

    I don't know much about Word and need some suggestions on how to begin to troubleshoot this problem.

    Thanks.

    Code:
    With wdApp
            .Selection.ParagraphFormat.TabStops.Add Position:=.InchesToPoints(4.25), Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
            .Selection.ParagraphFormat.TabStops.Add Position:=.InchesToPoints(5), Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
            
            .Selection.TypeText Text:="B.C. CORONERS SERVICE" & vbTab & "TOXICOLOGY REPORT"
            .Selection.TypeParagraph
            .Selection.TypeParagraph
    
            .Selection.ParagraphFormat.TabStops.Add Position:=.InchesToPoints(1.5),  Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
    
            .Selection.TypeText Text:="PTC No:" & vbTab
            .Selection.Font.Bold = wdToggle
            .Selection.TypeText Text:= Format(rs!Case_PTC_No, "####-####")
            .Selection.Font.Bold = wdToggle
            .Selection.TypeParagraph
            .Selection.TypeParagraph
    
            .Selection.TypeText Text:="The results are as follows: (* indicates new result)"
            .Selection.TypeParagraph
            .Selection.TypeParagraph
    Attached Images Attached Images  

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