Click here to Skip to main content
15,921,643 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Combobox not Responsive Pin
bobbymale7729-Jan-09 12:10
bobbymale7729-Jan-09 12:10 
GeneralRe: Combobox not Responsive Pin
Wendelius29-Jan-09 12:18
mentorWendelius29-Jan-09 12:18 
QuestionExport to MS Word form MS access database or Datagridview Pin
ivo7529-Jan-09 1:28
ivo7529-Jan-09 1:28 
AnswerRe: Export to MS Word form MS access database or Datagridview Pin
Eddy Vluggen29-Jan-09 1:57
professionalEddy Vluggen29-Jan-09 1:57 
GeneralRe: Export to MS Word form MS access database or Datagridview Pin
ivo7529-Jan-09 2:04
ivo7529-Jan-09 2:04 
GeneralRe: Export to MS Word form MS access database or Datagridview Pin
EliottA29-Jan-09 5:20
EliottA29-Jan-09 5:20 
JokeRe: Export to MS Word form MS access database or Datagridview Pin
ivo7529-Jan-09 7:59
ivo7529-Jan-09 7:59 
AnswerRe: Export to MS Word form MS access database or Datagridview Pin
ivo7529-Jan-09 8:03
ivo7529-Jan-09 8:03 
OK I put the code, code is
Private Sub Export_Word()
Dim oWord As Word.Application
Dim oDoc As Word.Document
oWord = New Word.Application
oDoc = New Word.Document

oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
oDoc.ActiveWindow.Selection.Tables.Add(Range:=oDoc.ActiveWindow.Selection.Range, NumRows:=DataGridView1.RowCount, NumColumns:=3)
'numcolumns:= has to be customized

'Create headers
oDoc.Tables(1).Columns(1).Cells(1).Range.Text = "Име на работник"
oDoc.Tables(1).Columns(1).Cells(1).Range.Font.Bold = True
oDoc.Tables(1).Columns(1).Cells(1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
oDoc.Tables(1).Columns(1).Width = 220
oDoc.Tables(1).Columns(2).Cells(1).Range.Text = "Обект"
oDoc.Tables(1).Columns(2).Cells(1).Range.Font.Bold = True
oDoc.Tables(1).Columns(2).Cells(1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
oDoc.Tables(1).Columns(3).Cells(1).Range.Text = "Дата на работа"
oDoc.Tables(1).Columns(3).Cells(1).Range.Font.Bold = True
oDoc.Tables(1).Columns(3).Cells(1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
oDoc.Tables(1).Columns(3).Width = 80

'etc.
Dim i As Integer
'Export data
i = 2
oDoc.Tables(1).Columns(1).Cells.Add()
For Each row In DataGridView1.Rows
oDoc.Tables(1).Columns(1).Cells(i).Range.Text = row.Cells(0).Value
oDoc.Tables(1).Columns(2).Cells(i).Range.Text = row.Cells(1).Value
oDoc.Tables(1).Columns(3).Cells(i).Range.Text = row.Cells(2).Value
'etc.
i = i + 1
Next
End Sub
QuestionHarddisk Serial Number using VB.net Pin
VikashGohil28-Jan-09 21:51
VikashGohil28-Jan-09 21:51 
AnswerRe: Harddisk Serial Number using VB.net Pin
«_Superman_»28-Jan-09 22:23
professional«_Superman_»28-Jan-09 22:23 
GeneralRe: Harddisk Serial Number using VB.net Pin
VikashGohil29-Jan-09 1:09
VikashGohil29-Jan-09 1:09 
GeneralRe: Harddisk Serial Number using VB.net Pin
«_Superman_»29-Jan-09 1:43
professional«_Superman_»29-Jan-09 1:43 
GeneralRe: Harddisk Serial Number using VB.net Pin
Luc Pattyn29-Jan-09 5:38
sitebuilderLuc Pattyn29-Jan-09 5:38 
QuestionVB Compile problem Pin
Member 152314228-Jan-09 20:20
Member 152314228-Jan-09 20:20 
Questionchechk box Pin
kulandaivel_mca200728-Jan-09 19:25
kulandaivel_mca200728-Jan-09 19:25 
General[Message Deleted] Pin
Sam McKay28-Jan-09 14:15
Sam McKay28-Jan-09 14:15 
QuestionSuggestions on using XmlTextReader to parse xml into an object tree. Pin
wout de zeeuw28-Jan-09 7:39
wout de zeeuw28-Jan-09 7:39 
QuestionRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
led mike28-Jan-09 9:06
led mike28-Jan-09 9:06 
AnswerRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
wout de zeeuw28-Jan-09 13:53
wout de zeeuw28-Jan-09 13:53 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
N a v a n e e t h28-Jan-09 14:56
N a v a n e e t h28-Jan-09 14:56 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
wout de zeeuw28-Jan-09 23:39
wout de zeeuw28-Jan-09 23:39 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
led mike29-Jan-09 4:58
led mike29-Jan-09 4:58 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
wout de zeeuw29-Jan-09 5:10
wout de zeeuw29-Jan-09 5:10 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
led mike29-Jan-09 5:20
led mike29-Jan-09 5:20 
GeneralRe: Suggestions on using XmlTextReader to parse xml into an object tree. Pin
wout de zeeuw29-Jan-09 5:25
wout de zeeuw29-Jan-09 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.