0
我試圖在Excel中打開一個Word文檔以便將一堆信息轉儲到其中。我使用下面的代碼:使用VBA在Excel中打開Microsoft Word文檔
'Declare a variable as a FileDialog object and create a FileDialog object as a File Picker dialog box
Dim iFileSelect As FileDialog
Set iFileSelect = Application.FileDialog(msoFileDialogFilePicker)
'Declare a variable to contain the path of each selected item
Dim vrtSelectedItem As Variant
'Use the Show method to display the File Picker dialog box
'The user pressed the action button
If iFileSelect.Show = -1 Then
For Each vrtSelectedItem In iFileSelect.SelectedItems
'vrtSelectedItem contains path of each selected item
MsgBox "The path is: " & vrtSelectedItem
Next vrtSelectedItem
End If
'Set object variable to Nothing
Set iFileSelect = Nothing
我「有米以下問題:
- 我如果文檔竟開或不不知道
- 如何關閉和保存。文件一旦我有傾倒的信息成嗎?
很酷。但是,你將如何編輯並從VBA保存相同的內容?發送密鑰......只是在開玩笑:) – cyboashu