14. august 2002 - 13:22Der er
5 kommentarer og 1 løsning
VB6.0 -> Word 2000
HJÆLP!!!
Jeg har denne kode her: ------------------------------------------------------- Private Sub skrivbrev_Click() Dim objWord As New Word.Application Dim WordDoc As New Word.Document Set WordDoc = objWord.Documents.Add("C:\brev.dot") Call InsertAtBookmark(WordDoc, "navn", navn.Text) Call InsertAtBookmark(WordDoc, "Adress", adress.Text) Call InsertAtBookmark(WordDoc, "postnr", postnr.Text) Call InsertAtBookmark(WordDoc, "by", by.Text) Call InsertAtBookmark(WordDoc, "land", land.Text) objWord.Visible = True
End Sub ----------------------------------------------------- Public Function InsertAtBookmark(objWordDoc As Word.Document, _ strBookmark As String, strText As String) As Boolean With objWordDoc.Bookmarks If .Exists(strBookmark) Then .Item(strBookmark).Range.Text = strText InsertAtBookmark = True End If End With End Function ------------------------------------------------------- MEN hvordan laver jeg om på skrifttypen på hver enkelt!!!
Feks at navnet bliver med fed... men alt det andet er bare normalt??????
I lang tid har samarbejdsbranchen fokuseret på at forbedre enhedsfunktioner – bedre kameraer, klarere lyd og smartere software. Men den virkelige forvandling handler ikke om funktioner.
Ok........ noget i denne stil her??? --------------------------------------------------------------------------- Public Function InsertAtBookmark(objWordDoc As Word.Document, _ strBookmark As String, strText As String) As Boolean With objWordDoc.Bookmarks If .Exists(strBookmark) Then End If
If strBookmark = "Kundenavn" Then .Item.Range.Bold = True Else .Item.Range.Bold = False End If
.Item(strBookmark).Range.Text = strText InsertAtBookmark = True End If End With End Function --------------------------------------------------------------------------- Den kommer bare med fejl, hvor den siger, "argument not optional"....???
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.