Home > Software engineering >  How can I use VB2013 open a WORD document, moved to the file beginning, draw a blue line?
How can I use VB2013 open a WORD document, moved to the file beginning, draw a blue line?

Time:10-01

Word. Document. Shapes. AddLine (100, 420, 500, 420)

How to set the line into the blue?

CodePudding user response:

AddLine method
Please refer to the application in the sample feature
When this method is applied to object Shapes, return to a Shape object, the object represents the new lines in the worksheet, when this method is applied to CanvasShapes object, return a Shape object, the object represents the new lines in the drawing canvas,

Expression. AddLine (BeginX, Beginy EndX, EndY)

Expression will choose the expression returns object Shapes,

BeginX, BeginY Single type, it is necessary, relative to the top left corner of the document, is given in pounds per line is the starting point of the position,

EndX EndY, Single type, it is necessary, relative to the top left corner of the document, is given in pounds per position at either end of the line,

Example
This example to myDocument, blue dashed line is added to the

The Set myDocument=Worksheets (1)
With myDocument. Shapes. AddLine (10, 10, 250, 250). The Line
. DashStyle=msoLineDashDotDot
. ForeColor. RGB=RGB (50, 0, 128)
End With
  •  Tags:  
  • VBA
  • Related