Thread View: cn.bbs.comp.lang.visual-basic
1 messages
1 total messages
Started by zx
Fri, 13 Mar 2009 06:41
��� vb����
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads