Hi
I've written a macro in word that when run copies the file name and path into a new document as hyperlinked text, and opens the document for emailing.
I want to recreate the same macro in Outlook 2003. At the moment as long as I give the file and path in the code, it works fine... But I want instead to open the 'Browse for file' window, and take the file path and name from here so my user can specify a different file each time.
Does anyone know how to do this, or where I can find an FAQ that will tell me how?
This is my code:
Sub SendAsLink()
Dim docpath, docname As String
' values I want to get from a browse window
docpath = "H:\test.doc"
docname = "test.doc"
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Subject = "Link to " & docname
.Body = "file:" & docpath
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks
Crabback
I've written a macro in word that when run copies the file name and path into a new document as hyperlinked text, and opens the document for emailing.
I want to recreate the same macro in Outlook 2003. At the moment as long as I give the file and path in the code, it works fine... But I want instead to open the 'Browse for file' window, and take the file path and name from here so my user can specify a different file each time.
Does anyone know how to do this, or where I can find an FAQ that will tell me how?
This is my code:
Sub SendAsLink()
Dim docpath, docname As String
' values I want to get from a browse window
docpath = "H:\test.doc"
docname = "test.doc"
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Subject = "Link to " & docname
.Body = "file:" & docpath
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks
Crabback