Results 1 to 7 of 7
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Call up a centralized Signature block

    How can I call up a signature block instead of having it in every one of my email body



    .Body = "For your action." & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "V/R" & vbCrLf & vbCrLf & "Name" & vbCrLf & vbCrLf & "Command& vbCrLf & "Division" & vbCrLf & "Address" & vbCrLf & "Address 2" & vbCrLf & "Phone" & vbCrLf & "Email"

    Additionally I would like to know how you would incorporate a set message by form/report output. Here as a standard I have "For your action.", other emails I have something different.

    The code for the email is Public off of a command button.

    idea = .Body = StrMessage & call sigBlock

    Where would the sigblock be at?

    Thanks

    Wayne

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Likely in a standard module, either as a function if it's getting the values from somewhere, or a constant if it's a static string.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    It would be static, I removed the pertinent data to make it generic for the forum. How do I make a standard module? I am used to going off a form/report. Since I already have "Start" form as open all the time, then I just put in on a Call form_Start.Sigload or something to that effect?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In the VBA editor, Insert/Module. Then

    Public Const strSigBlock As String = "Blah"

    Then in your code simply:

    idea = .Body = StrMessage & strSigBlock
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Ok I figured out how to make the Standard module. Select Module...

    Now that I have that I get an error in the module itself.
    Public SigBlk
    Dim SigBlk as String
    SigBlk = Chr(13) & Chr(10) & Chr(13) & Chr(10) & "V/R" & Chr(13) & Chr(10) & Name" & Chr(13) & Chr(10) & "Command" & Chr(13) & Chr(10) & "Division" & Chr(13) & Chr(10) & "Address 1" & Chr(13) & "Address 2" & Chr(13) & Chr(10) & "Phone" & Chr(13) & Chr(10) & "Emaill"
    End Sub

    Errors on the first 13 "Invalid Outside Error"

    Or if I use
    vbCrLf & vbCrLf & vbCrLf & vbCrLf & "V/R" & vbCrLf & vbCrLf & "Name" & vbCrLf & vbCrLf & "Command& vbCrLf & "Division" & vbCrLf & "Address" & vbCrLf & "Address 2" & vbCrLf & "Phone" & vbCrLf & "Email"

    It errors on the first vbCrlf

    If I use .Body, then I won't be able to have differing Comments above the Sig Block automatically.

    I was wanting to Call Module_SigBlk.SigBlk, then in the actual body code put:

    .Body = "whatever I want for the Message" & SigBlk

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    In both examples, you are missing a double quote.
    - In the example using "Chr(13) & Chr(10)", there should be a quote in front of NAME.
    - In the example using "vbCrLf", there should be a quote and a space after COMMAND.



    I think what Paul meant was to create a standard module, then add
    Code:
    Public Const SigBlk As String = vbCrLf & vbCrLf & vbCrLf  & vbCrLf & "V/R" & vbCrLf & vbCrLf & "Name" &  vbCrLf & vbCrLf & "Command" & vbCrLf & "Division" &  vbCrLf & "Address" & vbCrLf & "Address 2" & vbCrLf &  "Phone" & vbCrLf & "Email"
    or
    Code:
    Public Const SigBlk As String = Chr(13) & Chr(10) & Chr(13) & Chr(10) & "V/R" & Chr(13) & Chr(10) & "Name" & Chr(13) & Chr(10) & "Command" & Chr(13) & Chr(10) & "Division" & Chr(13) & Chr(10) & "Address 1" & Chr(13) & "Address 2" & Chr(13) & Chr(10) & "Phone" & Chr(13) & Chr(10) & "Emaill"

  7. #7
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks pbaldy & ssnafu. The example after ssnafus last post was done without knowing ssnafu replied. I used what ssnafu said with the full sig block. It worked like a charm. Maybe someday I will get the hang of it. Still learning. Your help is much appreciated.

    Wayne

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 08-25-2014, 11:10 AM
  2. Replies: 7
    Last Post: 11-27-2013, 08:37 AM
  3. Add Signature Box in a form
    By kowsigan in forum Forms
    Replies: 1
    Last Post: 12-20-2010, 03:58 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