vb.net 嵌入word word嵌入 vb.net窗体 - 电脑知识 - 【三明电脑网】_三明电脑维修_三明笔记本电脑维修_监控安装_市区上门维修

全国统一24小时服务热线:400-0000-000400-0000-000  / 1399000000

当前位置:首页 > 电脑知识 > 正文

vb.net 嵌入word word嵌入 vb.net窗体

发布日期:2020-07-23

摘要:VB net怎么添加引用word 在专业论坛上找了一个:Sub Macro1()Dim p$, f$, s$, a, arr, brr(1 To 6000, 1 To 20), d As Object...

vb.net 嵌入word

VB.net怎么添加引用word

在专业论坛上找了一个:Sub Macro1()Dim p$, f$, s$, a, arr, brr(1 To 6000, 1 To 20), d As Object, i&, l&, m&Set d = CreateObject("scripting.dictionary")a = Array("aaa", "身份证号码", "年龄", "姓名", "性别", "工作", "职业", "兴趣", "住址")For i = 1 To UBound(a)d(a(i)) = iNextp = ThisWorkbook.Path & "\"With CreateObject("word.application").Visible = Falsef = Dir(p & "*.doc")Do While f "".Documents.Open p & fFor l = 1 To .ActiveDocument.Tables.CountWith .ActiveDocument.Tables(l)For i = 1 To .Rows.Counts = Replace(.Cell(i, 1).Range.Text, Chr(7), "")s = Left(s, Len(s) - 1)If d.Exists(s) Then brr(m + d(s), 2) = Replace(.Cell(i, 2).Range.Text, Chr(7), "")NextFor i = 1 To 8brr(m + i, 1) = a(i)NextEnd Withm = m + 9Next.ActiveDocument.Closef = DirLoop.QuitEnd WithSet MyWord = NothingActiveSheet.UsedRange.ClearContents[a1].Resize(m, 2) = brrEnd Sub

vb.net操作word

将WDApp.wdParagraph直接修改成数值4,也就是变成 Unit:=4 试试看!同时将后面的:Alignment:=WDAPP.wdAlignTabRight改成:Alignment:=2, 将Leader:=WDAPP.wdTabLeaderDashes改成: Leader:=2如果今后遇到这种问题,直接打开Word,然后sub xx() msgbox wdParagraphend sub就可以得到wdParagraph的真实值。

...

vb.net 后台获取word中表格

"转到表格Public Sub GotoTheTable(ByVal ntable As Integer)Dim missing = System.Reflection.Missing.ValueDim what = Word.WdGoToItem.wdGoToTableDim which = Word.WdGoToDirection.wdGoToFirstDim count = ntableoWordApplic.Selection.GoTo(what, which, count, missing)oWordApplic.Selection.ClearFormatting()oWordApplic.Selection.Text = ""orange = oDocument.Tables(ntable).Cell(1, 1).Rangeorange.Select()End Sub

上一篇:ios上可以用的编程软件叫什么 ios上的c语言编程软件

下一篇:大学java用什么软件下载