|
-
Jan 25th, 2006, 08:38 AM
#1
Thread Starter
Hyperactive Member
Hyperlink Email Outlook
When I put the string "File:\" & Application.ActiveWorkbook.Path
(from Excel)
into the body of an Email, the link in the email stops at the first space.
Example: the full string becomes :"File:\C:\Program Files\Bla\Word.doc"
the link stops between Program and Files.
Does anyone knows how to make the spaces part of the link?
-
Jan 25th, 2006, 10:39 AM
#2
Re: Hyperlink Email Outlook
How are you placing the link in the email? Manually or via code?
You need to make sure your bodyformat is html and if your pasting manually then I believe you need to replace the spaces with "%20".
Here is how to place a link in an html email via code.
VB Code:
Option Explicit
'Add a reference to MS Outlook xx.0 Object Library
Private Sub Command1_Click()
Dim oApp As Outlook.Application
Dim oEmail As Outlook.MailItem
Set oApp = New Outlook.Application
Set oEmail = oApp.CreateItem(olMailItem)
oEmail.BodyFormat = olFormatHTML
oEmail.HTMLBody = "<A href='file://D:\Program Files'>D:\Program Files</A>" 'modify to your filepath
oEmail.Display
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 26th, 2006, 02:57 AM
#3
Thread Starter
Hyperactive Member
Re: Hyperlink Email Outlook
Did you know that if you turn the back-slashes into slashes
the file openes out of the internetexplorer?
Now it openes in Iexplorer.
Last edited by HWijngaarD; Jan 26th, 2006 at 03:01 AM.
-
Jan 26th, 2006, 03:25 AM
#4
Thread Starter
Hyperactive Member
Re: Hyperlink Email Outlook
I thought I had it.
I'm trying to open an Excel sheet in the email link.
When I open the link from the email
Excel openes the excelsheet within Iexplorer.
How do I open this sheet out of the internet explorer??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|