使用VB.NET将宏代码自动添加到Word中

问题描述 投票:-2回答:2

我想使用vb.net并自动将宏代码添加到word中并进行构建。这可能吗?

vb.net macros word
2个回答
0
投票

好吧,我正在使用VB.NET,并且在表单中添加了按钮,因此,当我单击此按钮时,它将使用word并将宏代码自动放入word中,并将其构建到桌面中

只需将我的代码放入宏并进行构建,


0
投票
 Dim oWord As Word.Application
    Dim oDoc As Word.Document
    Dim oTable As Word.Table
    Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
    Dim oPara3 As Word.Paragraph, oPara4 As Word.Paragraph
    Dim oRng As Word.Range
    Dim oShape As Word.InlineShape
    Dim oChart As Object
    Dim Pos As Double

    'Start Word and open the document template.
    oWord = CreateObject("Word.Application")
    oWord.Visible = True
    oDoc = oWord.Documents.Add

[[这不可能,我们可以使用单词应用程序来写入文本,但是我们无法打开和编辑宏吗?

© www.soinside.com 2019 - 2024. All rights reserved.