Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 43
  1. #16
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Perfect ridders52, you absolute star

  2. #17
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You're welcome. Just the signature to fix now?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #18
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Hi ridders52, you are a star for helping me get the logo on the mail body thank you, another one is, in the signatures, i have copied the .docx version of the signatures and saved as rtf and removed the Logo as the logo adds from another location, can i now add the text from the rtf below the logo ?? something like If Left(me.txtCustomer,3) = "thy" Then add path to orders signature below logo end if OR the following, i use tab control and have a hidden textbox called "txtIndexNo" this being the page that you are currently on the tab control, for example index3 is deliveries and index7 is collections so here we go, if me.txtIndexNo = "3" then do the mail, add the logo, add path to dispatch signature, if txtIndexNo = "7" then same again but add text from signature path collections@ , hope this makes sense!!! kind regards

  4. #19
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Back in post 13, I wrote:

    So if you only have a few signatures to include, I suggest you do one of the following:
    a) save a screenshot of each signature as an image file then use my code to include that the the email body
    b) save the signatures as html text in your code and include that
    c) save the signatures to a table then use a variable or function based on a DLookup to reference them in the code
    d) save the signature as 'business cards' and include those
    Using an rtf file for your signature files is more complex than any of these methods
    Please could you try one of these instead - probably b or c

    If it still fails, could you post a stripped down version of your database & I'll look at it later today - not for a few hours though
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #20
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Hi ridders, nearly there with signature, i have taken your approach by adding a table and using Dlookup based on a number indexNo text box, the most bizzare issue i am having now in which i have never had by using either Chr(10) or vbNewLine or vbCrlf, my address line is going under the logo in one line instead of a new line, see below, do you know why ?? note ID is a number that would be the same as txtIndexNo on the form, NOTE, I did try Chr(10) & _ Signature below the end of here:
    align=baseline></P>", still would generate new lines per signature!!!

    Dim MyApp As Outlook.Application
    Dim MyItem As Outlook.MailItem
    Dim BodyMessage, Orders, SigString, Signature As String
    Dim MySig As String
    Dim EMAdd As String


    EMAdd = DLookup("EmailAdd", "tblSignatures", "[IDNumber] = " & Me.txtIndexNo)


    Signature = "Unit 123," & Chr(10) & _
    "Some Street," & Chr(10) & _
    "Somewhere" & Chr(10) & _
    "Tel: 1234-56789" & Chr(10) & _
    "E-Mail:" & " " & EMAdd
    Set MyApp = CreateObject("Outlook.application")
    Set MyItem = MyApp.CreateItem(olMailItem)
    BodyMessage = "THIS IS A TEST EMAIL FROM DM" & Chr(10) & Chr(10) & _
    "<P><img border =0 hspace=0 alt='' src='C:\Users\David\Desktop\DMT\EmailLogo.jpg' align=baseline></P>"
    With MyItem
    Signature = MyItem.HTMLBody
    .To = "dave@dmoses.co.uk"
    .Subject = "TEST MAIL FROM DM"
    Debug.Print BodyMessage
    MyItem.HTMLBody = BodyMessage & vbNewLine & Signature
    Debug.Print .HTMLBody
    .Display
    End With

  6. #21
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Hi
    You said you are using a DLookup for the signature text but I can't see it.
    Why are you hard coding it in your code as Unit 123.... etc.

    To get a new line use Chr(13) & Chr(10) .... or vbcrlf or vbnewline should work for plain text
    But it's HTML text so I think you need paragraph markers
    <p> at start of each line and </p> at the end INSTEAD of vbnewline or equivalent

    Can you post a screenshot of the email so I can understand more clearly what you mean
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #22
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    The table consists of an IDNumber field and EmailAdd field, the IDNumber being the same as the txtIndexNo:
    EMAdd = DLookup("EmailAdd", "tblSignatures", "[IDNumber] = " & Me.txtIndexNo), I decided to get full address via VBA rather than table, the only Dlookup is email address based on IndexNo

    Signature = "Unit 123," & Chr(10) & _
    "Someplace," & Chr(10) & _
    "Somewhere" & Chr(10) & _
    "Tel: 1234-56789" & Chr(10) & _
    "E-Mail:" & " " & EMAdd

    I have quite often used Chr(10) & _ to create a new line, however reading your reply, it's HTML rather than text.

    I think the reason hard coding is because every signature will be the same apart from EMAdd Looked up from table

    Will post email shortly

    Much appreicated


  8. #23
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Click image for larger version. 

Name:	Email Result.jpg 
Views:	14 
Size:	131.3 KB 
ID:	34230

    Email result from post 22

  9. #24
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    email result from post 20 sorry

  10. #25
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by DMT Dave View Post
    The table consists of an IDNumber field and EmailAdd field, the IDNumber being the same as the txtIndexNo:
    EMAdd = DLookup("EmailAdd", "tblSignatures", "[IDNumber] = " & Me.txtIndexNo), I decided to get full address via VBA rather than table, the only Dlookup is email address based on IndexNo

    Signature = "Unit 123," & Chr(10) & _
    "Someplace," & Chr(10) & _
    "Somewhere" & Chr(10) & _
    "Tel: 1234-56789" & Chr(10) & _
    "E-Mail:" & " " & EMAdd

    I have quite often used Chr(10) & _ to create a new line, however reading your reply, it's HTML rather than text.

    I think the reason hard coding is because every signature will be the same apart from EMAdd Looked up from table

    Will post email shortly

    Much appreicated

    See https://www.asciitable.com/
    Chr(13) is a carriage return = vbCr ; Chr(10) is a line feed = vbLf - combined gives vbCrLf or vbNewLine

    BUT not for HTML text ...
    Try this:

    Code:
    Signature = <P>"Unit 123,"</P>
    <P>"Someplace,"</P>
    <P>"Somewhere"</P>
    <P>"Tel: 1234-56789"</P>
    <P>"E-Mail:" & " " & EMAdd</P>
    BTW - you would need that notation in the table as well
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #26
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Comes up compile error as highlighted in red when pasted into code, changed EmailAdd in Signatures Table to <p> orders@dmoses.co.uk </p> still no joy but I think if we correct the compile error it will probably work!

    Again much appreciated

  12. #27
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    OOPS. Sorry. Brain wasn't in gear.
    Try this instead - hopefully correct this time!

    Code:
    Signature = "<P>Unit 123,</P>" & _
    "<P>Someplace,</P>" & _
    "<P>Somewhere</P>" & _
    "<P>Tel: 1234-56789"</P> & _
    "<P>E-Mail:" & " " & EMAdd</P>"
    If that still fails, feel free to upload and I'll look at it tomorrow
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  13. #28
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    Hi ridders52, cracked it, I have bypassed the highlighted and slightly changed address line of signature and all works, last thing to do is change the email address to Hyperlink to click and mail, am I better changing the field property in the table from short text to Hyperlink ?

    Dim MyApp As Outlook.Application
    Dim MyItem As Outlook.MailItem
    Dim BodyMessage, Orders, SigString, Signature As String
    Dim MySig As String
    Dim EMAdd As String
    EMAdd = DLookup("EmailAdd", "tblSignatures", "[IDNumber] = " & Me.txtIndexNo)
    Signature = "<P>Unit 123,</P>" & Chr(10) & _
    "<P>Someplace,</P>" & Chr(10) & _
    "<P>Somewhere</P>" & Chr(10) & _
    "<P>Tel: 1234-56789</P>" & Chr(10) & _
    "E-Mail:" & " " & EMAdd
    Set MyApp = CreateObject("Outlook.application")
    Set MyItem = MyApp.CreateItem(olMailItem)
    BodyMessage = "THIS IS A TEST EMAIL FROM DM" & Chr(10) & Chr(10) & _
    "<P><img border =0 hspace=0 alt='' src='C:\Users\David\Desktop\DMT\EmailLogo.jpg' align=baseline></P>"
    With MyItem
    'Signature = MyItem.HTMLBody
    .To = "dave@dmoses.co.uk"
    .Subject = "TEST MAIL FROM DM"
    Debug.Print BodyMessage
    MyItem.HTMLBody = BodyMessage & Chr(10) & _
    Signature
    Debug.Print .HTMLBody
    .Display
    End With

  14. #29
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    My DB at work that I built from scratch, i have a question that you may know the answer, i will do this one in 2 posts, next is brief explanation step of procedure

    1 Customer uploads a purchase order onto our server
    2 the purchase order is named as SL-123456
    3 I have a combo called cboFolder in which after update refreshes another combo called cboViewPO
    4 Click on the desired SL- and it adds to Database via a recordset providing we have got a shipment date selected
    5 It auto adds to our SL- field exactly as per cboViewPO current name ie: SL-653874
    6 I use a form in datasheet view so the new addition appears at the top
    7 We fill in all details required from SL-653874

    Although these are PDF docs in the cboViewPO, like mentioned, when selected it auto adds a new record and auto adds the SL- number,

    Although PDF's are images, is there a method to read data from a PDF document ? so lets say, On PDF doc SL-653874, the Purchase Order is PO-987654, can this be read and added via the recordset ?

    I will post x 2 vba's that refreshes the cboFolder (this is to select which folder to view files in cboViewPO)

    Thanks again

  15. #30
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,185
    From post 29, this is cboFolder

    Dim fso As Object, flD As Object, Fil As Object
    Dim SubFolderName As String
    Dim FSOa As Object, flda As Object, Fila As Object
    Dim SubFolderNamea As String
    Dim i, i2 As Integer
    Dim MyFldName As String

    If Me.cboShipmentDateIndex1 = "" Then ' this is tab control page 1 hence named as Index1 at the end, going back to email signatures, if index1 is open then adds signature
    MsgBox ("You Have Not Selected A Shipment Date" & Chr(10) & Chr(10) & _
    "Select A Shipment Date Now !"), vbInformation + vbOKOnly, "NO SHIPMENT DATE"
    DoCmd.CancelEvent
    Else
    If Me.cboFolder = "Manifest PO's" Then
    Set fso = CreateObject("Scripting.FileSystemObject")
    Me.cboViewPO.RowSource = ""
    Me.cboViewPO.Requery
    SubFolderName = "T:\CustomerName\Manifest PO's"
    Set flD = fso.getfolder(SubFolderName)
    For Each Fil In flD.Files
    i = i + 1
    Me.cboViewPO.AddItem Fil.Name 'added
    Next Fil
    Me.lblPOs.Caption = i & " " & "CustomerName SL's"
    Me.cboViewPO.Requery
    If i = "" Then
    Me.txtFldQty = "0"
    Else
    Me.txtFldQty = i
    End If
    End If
    End If

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Gmail signature with email address syntax error
    By Gina Maylone in forum Access
    Replies: 2
    Last Post: 01-26-2016, 07:41 AM
  2. Add Outlook Signature to Email - CODE
    By floyd in forum Programming
    Replies: 1
    Last Post: 11-27-2013, 09:23 AM
  3. Code to include Outlook Signature in Email from Access
    By floyd in forum Code Repository
    Replies: 0
    Last Post: 11-27-2013, 08:52 AM
  4. Replies: 7
    Last Post: 11-27-2013, 08:37 AM
  5. adding signature to the email sendobject
    By webisti in forum Access
    Replies: 3
    Last Post: 07-10-2012, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums