officeXPÏÂʹÓÃÎļþ¶Ô»°¿òµÄÁíÍâÒ»ÖÖ·½·¨
ÒÔǰʹÓÃÎļþ¶Ô»°¿ò ´ó¸Å´ó¼Ò¶¼ÓÐͬ¸Ð°É Ҫô±ØÐëÁíÍâÌí¼Ó¿Ø¼þ,ҪôʹÓÃAPIº¯Êý Æäʵ»¹ÓÐÒ»ÖÖ·½·¨,²»ÖªµÀÀϲ»ÀÏ,²»¹ýÍÃÍÃÊǵÚÒ»´Î·¢ÏÖ´ó¼Ò¿ÉÒÔÈ¥¿´Ò»ÏÂÂÞ˹ÎÄÊý¾Ý¿âÖеÄ[¹ÍÔ±]´°Ìå ÆäÖеÄ"Ìí¼Ó/ɾ³ý"°´Å¥µã»÷¾Í³öÏÖ Îļþ¶Ô»°¿ò ÎÒ×¢Òâ¿´ÁËһϴ°ÌåÉè¼Æ,ûÓжԻ°¿ò ¿Ø¼þŶ ¶øÆä´ò¿ªµÄº¯ÊýÊÇÈçÏÂ,ҲûÓÐÓõ½api Sub getFileName() ' ÏÔʾһ¸ö Office ´ò¿ªÎļþ¶Ô»°¿ò£¬Îªµ±Ç°µÄ¹ÍÔ±¼Ç¼ ' Ñ¡ÔñÒ»¸öÎļþÃû£®Èç¹ûÓû§Ñ¡ÔñÁËÒ»¸öÎļþ£¬ ' Ôò½«ËüÏÔʾµ½Í¼Æ¬¿Ø¼þÖÐ Dim fileName As String Dim result As Integer With Application.FileDialog(msoFileDialogFilePicker) .Title = "Ñ¡Ôñ¹ÍÔ±ÕÕƬ" .Filters.Add "ËùÓÐÎļþ", "*.*" .Filters.Add "JPEGs", "*.jpg" .Filters.Add "λͼÎļþ", "*.bmp" .FilterIndex = 3 .AllowMultiSelect = False .InitialFileName = CurrentProject.path result = .Show If (result <> 0) Then fileName = Trim(.SelectedItems.Item(1)) Me![ÕÕƬ·¾¶].Visible = True Me![ÕÕƬ·¾¶].SetFocus Me![ÕÕƬ·¾¶].Text = fileName Me![ÐÕÊÏ].SetFocus Me![ÕÕƬ·¾¶].Visible = False ´íÎóÐÅÏ¢.Visible = False End If End With End Sub ºóÀ´±È½ÏÁËһϠÔÀ´ÊÇÓõÄÕâ¸ö¿Ø¼þ,ÎûÎû,Õâ¸öÖ»Òª°²×°ÁËoffice,¿ÉÊǶ¼ÓеÄŶ ÏÖÔÚ¿ÉÒÔ²»ÓÃÔÚ×°ÆäËûµÚÈý·½¿Ø¼þÀ²Å¶ Library Office C:\Program Files\Common Files\Microsoft Shared\office10\mso.dll Microsoft Office 10.0 Object Library FileDialog ÊôÐÔ Çë²ÎÔÄ Ó¦ÓÃÓÚ Ê¾Àý ÌØÐÔ ·µ»ØÒ»¸ö FileDialog ¶ÔÏ󣬴ú±íÎļþ¶Ô»°¿òµÄÒ»¸öʵÀý¡£
expression.FileDialog(dialogType) expression ±ØÐè¡£·µ»Ø¡°Applies To¡±ÁбíÖеÄÒ»¸ö¶ÔÏóµÄ±í´ïʽ¡£ dialogType ±ØÐ裬MsoFileDialogType¡£Îļþ¶Ô»°¿òµÄÀàÐÍ¡£
--------------------------------------------------------------------------------
Ïà¹ØÎÄÕÂ
ÖØж¨Î»Á´½Ó±í¶þ²½×ß 2003-10-17 19:00:07
ΪºÎ´°ÌåµÄ¼üÅÌʼþ²»ÏìÓ¦£¿ 2003-10-17 18:56:56
|