Consulting

Results 1 to 4 of 4

Thread: Send Link?

  1. #1

    Send Link?

    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

  2. #2
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by hilaryjade
    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
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

  3. #3
    Thank you, thank you!

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

    Hilary

  4. #4
    VBAX Expert
    Joined
    Feb 2005
    Posts
    929
    Location
    Quote Originally Posted by hilaryjade
    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.
    "It's not just the due date that's important, it's also the do date" [MWE]

    When your problem has been resolved, mark the thread SOLVED by clicking on the Thread Tools dropdown menu at the top of the thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •