Connecting Tech Pros Worldwide Forums | Help | Site Map

Drawing a line on the cursor position

Newbie
 
Join Date: Feb 2007
Posts: 5
#1: Oct 10 '09
hello I send to items to Microsof t word with this code:

Expand|Select|Wrap|Line Numbers
  1.   Dim wdApp As Word.Application
  2.    Dim oDoc As Word.Document
  3.    Dim oRange As Word.Range
  4.  
  5.    'Create new hidden instance of Word.
  6.    Set wdApp = New Word.Application
  7.  
  8.    With wdApp
  9.        ' Show this instance of Word.
  10.        .Visible = True
  11.        .ScreenUpdating = False
  12.        ' Code to automate Word here.
  13.        'Add a new document
  14.        Set oDoc = .Documents.Add
  15.    End With
  16.    Set oRange = oDoc.Range
  17.    With oRange
  18.        'move the cursor to start
  19.        .Collapse wdCollapseStart
  20.        'Make center current paragraph alignment
  21.       .ParagraphFormat.Alignment = wdAlignParagraphCenter
  22.        'To insert a paragraph or new line
  23.  
  24.        'to insert a text
  25.        .InsertAfter "ك˜الٍزك رداخت زش˜ خالنادم"
  26.        'Move the insertion point to end;
  27.       .Collapse Direction:=wdCollapseEnd
  28.        .InsertAfter vbCrLf
  29.  
  30.  
  31.        .InsertAfter "لاك ن لاك خالنادٍ" & ":" & Label7.Caption
  32.        .InsertAfter vbTab
  33.        .InsertAfter "ساف" & ":" & MSFlexGrid1.TextMatrix(1, 1)
  34.  
  35.  
  36.  
after this code I want draw a line in this document .
How can I do this?
Reply


Similar Visual Basic 4 / 5 / 6 bytes