Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Aus Excel ein Word Inhalt lesen

06.11.2020 (👁7945)

Vba Code Beispiel:
mit Excel ein Word Dokument lesen.

In Word Makro ist der Code :

Dim app_Word As New Word.Application

Dim doc As Word.Document

Set doc = app_Word.Documents.Open(sWord_Filepath, ReadOnly:=True, Visible:=False)   

doc.Content.Copy

Dim cell As Range

Set cell = ActiveSheet.Range("C14")

cell.PasteSpecial xlPasteAll

 

Option Explicit On

Private Const iColumn_Senden As Integer = 2

Private Const iColumn_Anhang As Integer = 5

'===================< Region: Email >===================

Public Sub Button_Read_Word_File()

    '-------------< Button_Read_Word_File() >-------------

    '*Open and Read Word File in same Folder

    '-< init >-

    Dim sPath As String

    sPath = Application.ActiveWorkbook.Path

    Dim sWord_Filepath As String

    sWord_Filepath = sPath & "\" & "Text_for_Excel.docx"

    '-</ init >-

    Dim app_Word As New Word.Application

    Dim doc As Word.Document

    Set doc = app_Word.Documents.Open(sWord_Filepath, ReadOnly:=True, Visible:=False)

   

    '< copy word content >

    doc.Content.Copy

    Dim cell As Range

    Set cell = ActiveSheet.Range("C14")

    cell.PasteSpecial xlPasteAll

    '</ copy word content >

    '< close word >

    doc.Close SaveChanges:=False

    '</ close word >

    '-------------</ Button_Read_Word_File() >-------------

End Sub