2014-01-14 49 views
2

我希望能夠從我的Outlook郵件帳戶發送一封html郵件,該郵件解釋瞭如何在Outlook中打開開發者選項卡並使用宏編輯器我遵照指示(從Outlook apps)但有我的代碼卡住了。在Outlook中通過VBA插入html

我的代碼是;

Sub InsertHTMLFile() 
Dim insp As Inspector 
Set insp = ActiveInspector 
If insp.IsWordMail Then 
Dim wordDoc As Word.Document 
Set wordDoc = insp.WordEditor 
wordDoc.Application.Selection.InsertFile 「C: UsersPreeceyDesktoppaper_Jan.html「 , , False, False, False 
End If 
End Sub 

我得到錯誤5273 the document name or file path is not valid.

我一直在使用這條道路file:///C:/Users/Preecey/Desktop/paper_Jan.html試過,但然後我得到; Compile error: Expected: line number or label or statement or end of statement

我想我有文件路徑錯誤,但我不知道它應該是什麼樣子。我已經尋找解決方案的小時,但迄今爲止我都不明智。任何幫助將非常感激。與普通引號 「」 引號:

謝謝,克里

+1

'C:\用戶\ Preecey \桌面\ paper_Jan.html' –

回答

3

替換「UsersPreeceyDesktoppaper_Jan.html C」。

「」與 「」

希望這有助於

+0

感謝,它幫助我 –