¥Îexcel vba ±±¨îword ¨Ã±Nuserformªº¸ê®Æ¶ñ¤Jwordªºªí®æ¤¤
- ©«¤l
- 47
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 82
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- xp
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-7-4
- ³Ì«áµn¿ý
- 2021-9-4
|
¥Îexcel vba ±±¨îword ¨Ã±Nuserformªº¸ê®Æ¶ñ¤Jwordªºªí®æ¤¤
¥»©«³Ì«á¥Ñ ciboybj ©ó 2019-7-30 22:25 ½s¿è
¤j®a¦n:)
§Ú¼g¤F¤@Ó¤pµ{¦¡¦bExcel VBA¤¤
¥Dn¬O¦³¤@ÓUserform ¸Ì±¦³¤@Ó¡y«ö¶s¡z¡A¨Ï¥ÎªÌ«ö¤U¡y«ö¶s¡z«á
vba·|¶}±Ò¦P¤@¸ô®|¤U¦W¬°¡y½d¥»¡zªºwordÀÉ
¶}±ÒwordÀÉ«á¡A±N´M§ä wordÀɮפ¤ªº¡y ½s¸¹¡z ¦r¦ê¡A§ä¨ì¡y ½s¸¹¡z ªº¦r¦ê«á¡A¦V¥kÃä²¾°Ê¨âÓ¦r¤¸(²¾¨ì¹j¾Àªº®æ¤l¤¤)¡A¨Ã´¡¤Juserform¤¤¬Y¤@Ӽж¡ªº¦r¦ê- Private Sub CommandButton2_Click()
- Dim path As String
- path = ThisWorkbook.path & "\½d¥».docx"
- 'Debug.Print (path)
- Set WordApp = CreateObject("Word.Application")
- WordApp.Documents.Open (path)
- WordApp.Visible = True
- WordApp.Activate
- WordApp.Selection.homekey unit:=6
-
- WordApp.Selection.Find.Execute FindText:="½s¸¹" ', Forward:=True, Wrap:=wdFindStop
- WordApp.Selection.MoveRight = 2
- WordApp.Selection.InsertAfter = LB_Num.Caption
-
- End Sub
½Æ»s¥N½X ¦ý¬O¡A§Ú°õ¦æ¤W±ªºµ{¦¡½X«á¡A¥X²{¤F¥H¤Uªº¿ù»~°T®§
·Q½Ð°Ý¤j®a
¬°¦ó¦³¤W±ªº¿ù»~°T®§ §Ún«ç»òקïµ{¦¡¤~¥i¥H¹B§@ªü¡ã¡ã¡ã{:3_50:}
test.rar (31.64 KB)
|
|
|
|
|
|
|
- ©«¤l
- 47
- ¥DÃD
- 19
- ºëµØ
- 0
- ¿n¤À
- 82
- ÂI¦W
- 0
- §@·~¨t²Î
- win
- ³nÅ骩¥»
- xp
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-7-4
- ³Ì«áµn¿ý
- 2021-9-4
|
¥Ø«e§ä¨ìªº¸Ñ¨M¤è¦¡¬O¡G
¦bvbaªº¤u¨ã¦C¤¤¿ï¾Ü¡y¤u¨ã¡z->¡y³]©w¤Þ¥Î¶µ¥Ø¡z
§âMicrosoft Word ªº¶µ¥Ø¤Ä°_
µ{¦¡½Xªº³¡¤À¦p¤U¡G- Private Sub CommandButton1_Click()
-
- Dim str As String
- str = TextBox1.Text
- Dim WordApp As Word.Application
- Set WordApp = New Word.Application
- WordApp.Documents.Open ThisWorkbook.Path & "\test.docm"
- WordApp.Visible = True
-
- WordApp.Selection.Find.Execute FindText:="½s¸¹"
- WordApp.Selection.Move Unit:=wdCell, Count:=1
- WordApp.Selection.InsertAfter str
- WordApp.Documents.Save
-
- Set WordApp = Nothing
- End Sub
½Æ»s¥N½X ¥Ñ©ó¦bword¤¤§ä¨ìªº¦r¬O¦bªí®æ¤¤¡A¦]¦¹¡An¥ÎwdCell ³oÓ²¾°Ê³æ¦ì¨Ó²¾°Ê¹«¼Ð¦ì¸m |
|
|
|
|
|
|