Hi
I create a word file from vb.net (thanks to Sweep)
Now I would like to put a sentence in Bold, put an Enter key, and put the other sentence without Bold.
Here is my code
I create a word file from vb.net (thanks to Sweep)
Now I would like to put a sentence in Bold, put an Enter key, and put the other sentence without Bold.
Here is my code
Code:
' Create invisible word application
Dim wrd As Word.Application
Try
wrd = New Word.Application
wrd.Visible = False
Catch ex As Exception
MsgBox("An error occured while printing, please try again")
End Try
' Create a new document & range
Dim doc As Word.Document = wrd.Documents.Add()
Dim rng As Word.Range = doc.Range()
...
...
...
For Each StringDr In StringDv
Select Case StringDr("No")
Case 500
rng.Text = StringDr("Message")
doc.Activate()
doc.CheckSpelling()
Case 501
rng.Text = StringDr("Message")
doc.Activate()
doc.CheckSpelling()