Article View: cn.bbs.comp.lang.visual-basic
Article #152��� vb����
From: zx
Date: Fri, 13 Mar 2009 06:41
Date: Fri, 13 Mar 2009 06:41
38 lines
2073 bytes
2073 bytes
����������һ����ȡword��ǩд����һ��word�ĵ��ij������г����ˣ���֪����������ˣ����λָ�㣬�����ˣ���л�ˡ���������
Private Sub Command1_Click()
Dim i As Integer
Dim str As String
'Dim objDoc As Document
Dim strFilePath As String
Dim wdapp As Word.Application
Dim wddoc As Word.Document
'����wordʵ��
Set wdapp = New Word.Application
wdapp.Visible = True
Set wddoc = Word.Documents.Open("c:\��ǩ.doc")
strFilePath = "c:\1.doc"
If Dir(strFilePath, vbNormal) = "" Then
Exit Sub
End If
Set objDoc = GetObject(strFilePath)
objDoc.Activate
For i = 1 To objDoc.Bookmarks.Count
'MsgBox objDoc.Bookmarks.Item(i).Name
str = objDoc.Bookmarks.Item(i).Name
'�word
doc.Content.InsertAfter Text:=str
Next i
objDoc.Close
wddoc.SaveAs "c:\��ǩ.doc", 3
wddoc.Close
wdapp.Quit
Set objDoc = Nothing
End Sub
--
[m[31m�� ��Դ:��BBS ˮľ�廪վ http://smth.edu.cn��[FROM: 118.122.113.*][m
Technical Details
Message-ID:
<4f0SLR$708@bbs.tsinghua.edu.cn>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.byr.edu.cn!SMTHShow Full Headers
Complete Article Headers
X-Google-Thread: 109fdd,a6c354e411f9259f,start X-Google-Attributes: gid109fdd,domainid0,public,usenet X-Google-Language: Chinese,GB Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.byr.edu.cn!SMTH From: pbvc@smth.edu.cn-SPAM.no (zx) Newsgroups: cn.bbs.comp.lang.visual-basic Subject: ��� vb���� Date: 13 Mar 2009 06:41:16 GMT Organization: BBS ˮľ�廪վ Message-ID: <4f0SLR$708@bbs.tsinghua.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: VisualBasic/p/M.1236926475.g0