PDA

View Full Version : [SOLVED] Send Link?



hilaryjade
06-09-2005, 11:32 AM
Hi:

I want to create a macro to email a link to the active workbook. I am in Excel 2003, and under the file menu have the option to send the workbook as an attachment, but since we are using SharePoint, I would like to have an option to simply send a link to active workbook. I know how to add an item to the menu--and I have some code examples for mailing with outlook--but nothing on the code I need to actually create the link.

Any help is greatly appreciated!

Hilary

MWE
06-10-2005, 09:41 AM
Hi:

I want to create a macro to email a link to the active workbook. I am in Excel 2003, and under the file menu have the option to send the workbook as an attachment, but since we are using SharePoint, I would like to have an option to simply send a link to active workbook. I know how to add an item to the menu--and I have some code examples for mailing with outlook--but nothing on the code I need to actually create the link.

Any help is greatly appreciated!

Hilary
Hi Hilary, If I understand your need correctly, you want to send a link to the active workbook via email. You know how to spawn a email using VBA and just need the fully qualified path name to the file. You can define the full path to the active workbook using the "path" property and then appending the filename:


Dim FullName as string
FullName = ActiveWorkBook.path & "\" & ActiveWorkBook.name

hilaryjade
06-10-2005, 09:45 AM
Thank you, thank you!

Will this also work if the file name or path has spaces in it? just curious--

Hilary

MWE
06-10-2005, 10:53 AM
Thank you, thank you!

Will this also work if the file name or path has spaces in it? just curious--

Hilary
The FileName fetched will be correct and will include whatever is in the full path. If there are spaces in either the actual file name or the path, there is a small possibility that the email program used by the recipient will encounter a problem. At one time there was a "rule" that spaces should never be embedded in directory or file names. I still abide by that rule and use the underbar, ie.., "_" , instead of a space. There are programs that get confused if there is a space in a path or URL. Having said that, Microsoft has spaces in many or its default directories, e.g., My Documents, My Music, My IrateLetterstoBillGates, etc.

I have seen lots of examples where paths are enclosed in quotes if there is a space.