09-02-13, 04:53 PM
نحمده ونصلي على رسوله الكريم
الكود لا يحتاج تعديلات، استخدمه كمان هو بعد اسم المتغير اللذي يشير لمكتبة MS Word:
الكود لا يحتاج تعديلات، استخدمه كمان هو بعد اسم المتغير اللذي يشير لمكتبة MS Word:
كود :
[align=left]Imports Microsoft.Office.Interop.Word
Imports Microsoft.Office.Core
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim w As New Microsoft.Office.Interop.Word.Application()
w.Visible = True
w.Activate()
w.Documents.Add()
'
Dim WdSelection As Selection
Dim WdInlineShape As InlineShape
Dim WdShape As Microsoft.Office.Interop.Word.Shape
WdSelection = w.ActiveWindow.Selection
WdInlineShape = WdSelection.InlineShapes.AddPicture("C:\Users\username\Pictures\portrait.jpg")
WdShape = WdInlineShape.ConvertToShape
' Set the color type
WdShape.PictureFormat.ColorType = MsoPictureColorType.msoPictureAutomatic
' Set the reflection type
WdShape.Reflection.Type = MsoReflectionType.msoReflectionType2
' Set the frame shape to oval
WdShape.AutoShapeType = MsoAutoShapeType.msoShapeOval
WdShape.Line.Style = MsoLineStyle.msoLineThickBetweenThin
WdShape.Line.Weight = 10
' Set the artistic picture effect
WdShape.Fill.PictureEffects.Insert(MsoPictureEffectType.msoEffectPlasticWrap)
' Set the size and color of the frame extrusion
WdShape.ThreeD.SetThreeDFormat(MsoPresetThreeDFormat.msoThreeD2)
'WdShape.ThreeD.ExtrusionColor = RGB(Red:=255, Green:=28, Blue:=0)
' Set the shape rotation and perspective
WdShape.ThreeD.RotationX = 35
WdShape.ThreeD.RotationY = 8
WdShape.ThreeD.RotationZ = 357
WdShape.ThreeD.Perspective = MsoTriState.msoTrue
End Sub
End Class
[/align]