تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
ممكن الخطا في الكود
#8
Imports word = Microsoft.Office.Interop.Word
Public Class Form12
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim strpathopen As String = ""
        Dim ofd As New OpenFileDialog
        With ofd
            .Filter = "word Document(*.docx)|*.docx|word 97-2003 Document(*.doc)|*.doc|Template(*.dotx)|*.dotx "
            .FilterIndex = 3
            .Title = "chose word file"
            .FileName = "chose only word file"
            .ShowDialog()
        End With
        If ofd.FileName <> "" Then
            TextBox1.Text = ofd.FileName
            strpathopen = ofd.FileName
        End If

    End Sub
    Public Sub Txtbox_to_template(templatepath As String)
        Try
            Dim oword As Word.Application
            Dim oDoc As New word.Document
            oword = CreateObject("word.Application")
            oDoc.Bookmarks("age1").Range.Text = Form10.TextBox3.Text
            oDoc.Bookmarks("abod1").Range.Text = Form10.TextBox4.Text
            oDoc.Bookmarks("hip1").Range.Text = Form10.TextBox5.Text
            oDoc.Bookmarks("abcd").Range.Text = Form10.TextBox7.Text
            oword.Visible = True

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim templatepath As String = ""
        Txtbox_to_template(TextBox1.Text)
    End Sub
End Class


ما الخطاء بلكود عند التشغيل ا=تضهر لي رساله عضو المجموعه المطلوب غير موجود
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
ممكن الخطا في الكود - بواسطة mostafa12 - 07-10-19, 06:41 PM
RE: ممكن الخطا في الكود - بواسطة nrkarat - 07-10-19, 07:01 PM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 07-10-19, 07:16 PM
RE: ممكن الخطا في الكود - بواسطة alshandodi - 07-10-19, 07:26 PM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 07-10-19, 07:41 PM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 07-10-19, 08:54 PM
RE: ممكن الخطا في الكود - بواسطة asemshahen5 - 07-10-19, 09:06 PM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 08-10-19, 02:17 AM
RE: ممكن الخطا في الكود - بواسطة asemshahen5 - 08-10-19, 02:25 AM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 08-10-19, 03:21 AM
RE: ممكن الخطا في الكود - بواسطة asemshahen5 - 08-10-19, 03:25 AM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 08-10-19, 03:36 AM
RE: ممكن الخطا في الكود - بواسطة asemshahen5 - 08-10-19, 04:06 AM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 08-10-19, 03:41 PM
RE: ممكن الخطا في الكود - بواسطة asemshahen5 - 08-10-19, 04:45 PM
RE: ممكن الخطا في الكود - بواسطة mostafa12 - 08-10-19, 05:50 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم