易截截图软件、单文件、免安装、纯绿色、仅160KB

VB 操作WORD 保存问题

我用VB在指定文件夹里读取一个word模版,里面是一个表,把数据库的内容写入word中,写可以成功了。
现在问题是保存,我想设定直接保存在指定的文件夹中。

先贴出我现在完成的代码:

    Dim Appword As Word.Application
    Dim Newword As Word.Document
    Set Appword = New Word.Application
    Set Newword = Appword.Documents.Add(App.Path + "\stencil" + "\stencil.doc")
    Appword.Visible = True
    Appword.WindowState = wdWindowStateMinimize
    Appword.Documents.Add

    With Newword
            .Tables(1).Cell(1, 1).Range.Text = txtName.Text
    End With
        Appword.ChangeFileOpenDirectory (App.Path + "\Result")

        Appword.ActiveDocument.SaveAs FileName:=(txtName.Text & ".doc"), FileFormat:=wdFormatDocument,  LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False

        Appword.Documents.Close

        Appword.Quit
        MsgBox "导出Word文件成功!"



相关问答:

vb如何调用Illustrator(此前Illustrator未启动)?

请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click()
Dim app As New Illustrator.Application
Dim doc As Illustrator.Document
Dim thislayer As Illustrator.Layer ......

从VB转行VB.NET~~~开始的时候如何学基础入门啊~

VB偶学得不错,现在大一,高三的时候就学VB了,现在学校里都是学C#和VB.NET的兄弟多。。。
偶要转行VB.NET了~当年学VB学了2年,对VB里面的常用函数都十分了解。
Select、If结构、For Next循环、等都了解。。。 ......

vb能否把winsock控件封装到dll中

vb将winsock控件封装到dll问题 有什么好的思路? 如果用Socket API呢?
例如,像下面这样封装Winsock控件,行的通?
创建ActiveX dll,添加窗体frmClient,加入WinSock控件wskClient。
类代码:
Option Expli ......

VB 请教高手关于用户控件问题

我制作了个用户控件,需要动态加载到窗体上

    Set objExt = Controls.Add("工程1.meActiveX", argName)
    objExt.Visible = True

程序一次能加载N个, 现在想对 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号