+ Reply to Thread
Results 1 to 3 of 3

Create PDF from active worksheet, attatch to mail and add signature

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    2

    Create PDF from active worksheet, attatch to mail and add signature

    Hello,

    I've been working on this ultimate macro for days. I've been using Ron de Bruin's macros from his site (http://www.rondebruin.nl), but I have some issues. I can't get it to work properly.

    First off, my macro creates a PDF file for my workbook. First problem here is that it creates a PDF of all sheets, not just the active one. I will never ever have to create a PDF of any other sheets than the very first one (called "Blad1" in my workbook).

    However, the macro lets me save the PDF file as and attaches it to a new e-mail in Microsoft Office Outlook 2007 (edited in HTML-format). Everything works fine, until I take a look at the signature. Here something peculiar happens. The logotype (a .jpg-file) looks broken. I have attached the htm-document according to Ron de Bruin's code, and I have double and triple-checked the file paths. The htm-document itself works fine.

    All I could find out when looking for any obvious errors was when I saved the e-mail as a HTML-file, opened in Internet Explorer and clicked "show source". Scrolling down to the bottom, I found something very strange. Here's what the lines look like in my original htm-document:

    PHP Code: 
    <v:imagedata src="informell-filer/image001.jpg" o:title="image001"/> </v:shape><![endif]--><![if !vml]><img width=346 height=77 src="informell-filer/image001.jpg" v:shapes="_x0000_i1025"><![endif]><o:p></o:p></span></p
    Everything works fine. The logotype called image001.jpg is located in the folder informell-filer.

    In the source of the e-mail however, the same lines look like this:

    PHP Code: 
    </v:shape><![endif]--><![if !vml]><img width=346 height=77 src="This%20is%20the%20Subject%20line-filer/image001.gif" alt=image001 v:shapes="Bild_x0020_1"><![endif]><span style='color:navy;mso-no-proof:yes'><o:p></o:p></span></p
    Somehow the macro changes the folder name in the file path to the same as the subject of the e-mail, but still it's adding -filer (meaning -files).

    I have no idea how to fix this, but I suspect there is something not right with the functions.

    (Please see next post.)

  2. #2
    Registered User
    Join Date
    07-09-2010
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Create PDF from active worksheet, attatch to mail and add signature

    Here is the full code I use, called RDB_Workbook_To_PDF_And_Create_Mail_with_signature().

    Please Login or Register  to view this content.
    Not all functions are used but I decided to keep them since I might need them to merge together the codes and make the whole 'active sheet into PDF'-thing achievable.

    I have Office 2007 and my Windows XP is in Swedish.

    I am very thankful for any help! I've been resarching for solutions to these problems for days now.

    Sincerely,
    Amanda
    Last edited by royUK; 07-09-2010 at 05:04 AM.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Create PDF from active worksheet, attatch to mail and add signature

    Please use Code Tags not PHP Tags, that way your code will display correctly. Presumable you have Excel 2007 or 2010 & the pdf addin installed
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1