Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb.net - Excel document

Status
Not open for further replies.

myrgir

Programmer
Feb 7, 2006
62
CA
Hi
I create a excel document and I add text in it.
What is weird is that it add my text beginning at the end
For exemple, I have point 1.0, 1.1
It will print

1.1
1.0

I don't understand why

here is my code
Code:
For Each StringDr In StringDv
    Select Case StringDr("No")
        Case "700" '1.0
            FirstTopicNumberMaster(StringDr("Message"))
        Case "701" '1.1
            TopicNumberMaster(StringDr("Message"))
    End Case
Next
docMaster.SaveAs(Path & "\" & "SpecMasterR34.doc")
wrd.Quit()


 Private Sub FirstTopicNumberMaster(ByVal sText As String)
        rngMaster = docMaster.Range(Start:=0, End:=0)
        With rngMaster
            .InsertAfter(Text:=sText)
            With .Font
                .Name = "Arial"
                .Size = 12
                .Bold = True
            End With
        End With
 End Sub

 Private Sub TopicNumberMaster(ByVal sText As String)
        rngMaster = docMaster.Range(Start:=0, End:=0)
        With rngMaster
            .InsertParagraphBefore()
            .InsertParagraphBefore()
            .InsertParagraphBefore()
            .InsertBefore(Text:=sText)
            With .Font
                .Name = "Arial"
                .Size = 12
                .Bold = True
            End With
        End With
 End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top