vb.net 嵌入word word嵌入 vb.net窗体 - 电脑|办公 - 电脑办公-杀毒安全-网络-V3学习网
微商网
 
 
导航:首页 |电脑|办公|正文

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

时间:2021-04-29 11:30:21
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

大家还关注
    
阅读排行
推荐阅读