excel ¦p¦ó±Nwordªº±±¨î¶µµ²ªGŪ¤J¡A¨Ó¥[¥H²Îp
- ©«¤l
- 14
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- excel 2000
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2010-5-17
- ³Ì«áµn¿ý
- 2023-3-24
|
excel ¦p¦ó±Nwordªº±±¨î¶µµ²ªGŪ¤J¡A¨Ó¥[¥H²Îp
¤£¬O¦b¶}±ÒwordÀÉ«á¡A§ä¨ì±±¨î¶µªºTAG¦AŪ¨ú¨äÈ´N¦n¤F¶Ü?(§Úªº±±¨î¶µ¥Dn¬Ocheckbox)
¬Ý¦ü®e©ö¡A¦ý«o¨ì¤£¤F¸Ó±±¨î¶µ(¬O¥Îselection.goto¶Ü?)¡A¤]§ä¤£¨ì¬ÛÃö¸ê®Æ°Ñ¦Ò~³Â·Ð¨ó§U¤@¤U~ |
|
|
|
|
|
|
- ©«¤l
- 14
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 25
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows XP
- ³nÅ骩¥»
- excel 2000
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2010-5-17
- ³Ì«áµn¿ý
- 2023-3-24
|
¤p§Ì¤w¦³§ä¨ì¸Ñ¨M¤è®×(¦p¤U)¡AÁÂÁ¤j®a¶O¤ß¤F~
Sub getWordItem()
Application.ScreenUpdating = False
Dim WDAPP As New Word.Application
Dim WDDOC As Word.Document
Dim CCtrl As Word.ContentControl
Dim strFolder As String
Dim WkSht As Worksheet
Dim i As Long, j As Long
strFolder = GetFolder
If strFolder = "" Then Exit Sub
Set WkSht = ActiveSheet
i = WkSht.Cells(WkSht.Rows.Count, 1).End(xlUp).Row
strFile = Dir(strFolder & "\*.docx", vbNormal)
While strFile <> ""
Set WDDOC = WDAPP.Documents.Open(filename:=strFolder & strFile, AddToRecentFiles:=False, Visible:=True)
With WDDOC
For Each CCtrl In .ContentControls
j=j+1
WkSht.Cells(i, j) =CCtrl.Checked
Next
End With
WDDOC.Close SaveChanges:=False
strFile = Dir()
Wend
WDAPP.Quit
Set WDDOC = Nothing: Set WDAPP = Nothing: Set WkSht = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String '¼È¤£¨Ï¥Î
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function |
|
|
|
|
|
|