none
VBA question, create custom index or array of Userform controls RRS feed

  • Question

  • I'm making an Excel Userform with 7 TextBoxes and a ComboBox where text is entered then a button copies the text to the clipboard and opens a new Outlook email with the text inserted.  However I'm not sure how to set the order of Controls where the text is copied.  Using the web I managed to get the following code but get an error "Subscript out of Range, runtime error 9" on sText = sText & MyCtrl(ctrl).Text & vbCrLf

    Please note with my apologies I'm a complete VBA novice!  One other thing, the text in txt1 (TextBox1) would be awesome as a hyperlink.  I looked around for doing that but could not find any code that was close.  -Thanks in advance!

    Private Sub CommandButton4_Click()
    Dim OutlookApp As Object
    Dim mItem As Object
    Dim GetClip As New DataObject
    Dim ctrl As Variant, sText As String
    Dim MyCtrl(0 To 7) As Control
        Set MyCtrl(0) = txt1
        Set MyCtrl(1) = txt2
        Set MyCtrl(2) = txt3
        Set MyCtrl(3) = txt4
        Set MyCtrl(4) = txt5
        Set MyCtrl(5) = txt6
        Set MyCtrl(6) = txt7
        Set MyCtrl(7) = txt8
    
    Set OutlookApp = CreateObject("Outlook.Application")
    Set mItem = OutlookApp.CreateItem(0)
        sText = ""
        For Each ctrl In MyCtrl
                sText = sText & MyCtrl(ctrl).Text & vbCrLf
            Next ctrl
        With GetClip
            .SetText sText
            .PutInClipboard
        End With
        With mItem
            .To = "Some email here"
            .Subject = "Test Subject!"
            .Body = "Your text here!" & vbCrLf & (sText)
            .Display
            End With
    Set GetClip = Nothing
    Set ctrl = Nothing
    End Sub

    • Moved by Bill_Stewart Saturday, July 26, 2014 12:12 PM Move to more appropriate forum
    Friday, July 25, 2014 5:31 AM

Answers

All replies

  • You are posting in the wrong forum.  Post in the Office VBA developer forum for VBA issues.

    I would start by getting some examples of how to build forms. Just copying arbitrary code won't work if you do not know anything.

    Hint:

     sText =sText & ctrl.Text &vbCrLf

    There is no order for controls.  You must access them by name in the order you need.  Creating an arbitrary "Control' array won't do anything.  You MUST create a form first  and place the controls on the form.  "Control" is not a usable control.  You must use Textbox or other creatable control.

    You still need to learn the basics of VBA code.


    ¯\_(ツ)_/¯


    • Edited by jrv Friday, July 25, 2014 8:03 AM
    Friday, July 25, 2014 8:00 AM
  • Searched for VBA  forum and found nothing.

    If someone can move the thread into the proper forum it would be most welcome.

    jrv: I said in my post I'm a novice to VBA and scripting/programming.  I spent a week searching for anything to accomplish my task but came up empty.  Yes, I have no clue what works and doesn't work beyond what the VBA compiler will accept and what it won't.  As such I have no idea what terminology to use when searching for examples or even basic help with regards to the goal I'm trying to accomplish.

                

    Looked under MS Office and found the following.

    Microsoft Office

    Outlook IT Pro Discussions

    Excel IT Pro Discussions

    Office 2013 and Office 365 ProPlus - IT Pro General Discussions

    Word IT Pro Discussions

    Office 2010 - Planning, Deployment, and Compatibility

    Office Legacy Versions - Planning, Deployment, and Compatibility

    Office 2010 - IT Pro General Discussions

    Office Legacy Versions - IT Pro General Discussions

    Office 2013 and Office 365 ProPlus - Planning, Deployment, and Compatibility


    • Edited by MaxFLipz Friday, July 25, 2014 8:32 AM remove html
    Friday, July 25, 2014 8:26 AM
  • What is all of that.  It is just HTML.

    Try here: http://social.msdn.microsoft.com/Forums/office/en-us/home?category=officedev


    ¯\_(ツ)_/¯

    Friday, July 25, 2014 8:30 AM
  • Here is the Excel forum for developers where you can ask questions about VBA in Excel.

    http://social.msdn.microsoft.com/Forums/office/en-US/home?forum=exceldev


    ¯\_(ツ)_/¯

    Saturday, July 26, 2014 11:04 AM
  • However I'm not sure how to set the order of Controls where the text is copied. 

    There are several ways, what about to write a number into the TAG property of the controls, e.g.

    Private Sub UserForm_Initialize()
      txt1.Tag = "1"
      txt2.Tag = "2"
      'etc.
    End Sub
    

    Then you can use a loop, visit all controls and sort the output with an array. See the function below.

    Andreas.

    Function GetControlText() As String
    Dim Result() As String
    Dim C As MSForms.Control
    Dim i As Long

    'Create an array for the max. result
    ReDim Result(1 To Me.Controls.Count)
    'Visit each control
    For Each C In Me.Controls
    'A number in the TAG property?
    If IsNumeric(C.Tag) Then
    i = CLng(C.Tag)
    'Be sure our setup is okay
    If i < LBound(Result) Or i > UBound(Result) Then
    Err.Raise 5, "GetControlText", "Setup error"
    End If
    'Store the value of the control into right place
    Result(i) = C
    End If
    Next
    'Create the result
    GetControlText = Join(Result, " ")
    'Remove duplicate blanks
    Do While InStr(GetControlText, " ") > 0
    GetControlText = Replace(GetControlText, " ", " ")
    Loop
    End Function

    Sunday, July 27, 2014 10:53 AM
  • Hi Andreas,

    Thank you for the suggestion, but it seems to have frozen the excel UserForm.  The VBA editor even stopped responding in the Running state.

    I take it I set the Function GetControlText then for a CommandButton click action set a variable as New DataObject to put the text in Clipboard but Excel is throwing a fit.  I'll keep trying until I get an error message.

    Tuesday, July 29, 2014 12:26 AM
  • Max - you are not really explaining what you are trying to accomplish.  Forget about code and control arrays.  What is it the you are trying to do on a user form?

    Nothing is this difficult - I suspect your approach is misguided.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 12:37 AM
  • Here is a hint as to how Windows Forms and controls work:

    Create a new user form. 
    Add a frame.
    Add 7 textboxes to the frame. 
    Add a button outside the frame. 
    Double click button to get to event code.
    Add the following code:

    Private Sub CommandButton1_Click()
         For Each c In Frame1.Controls
            Debug.Print c.Name
         Next
    End Sub

    Run under debugger and you will see the output of the controls by name and they will be in the order added (also in tab order).  This is how we create control arrays. TO get the contents in order just "for each" the controls collection of the frame and they will be returned in order.

    See:


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 12:50 AM
  • Oh yes - to gather the data in the textboxes  use this:

    Private Sub CommandButton1_Click()
         For Each c In Frame1.Controls
            Debug.Print c.Text
         Next
    End Sub

    If you type 1 through 7  in the text boxes this will print out a list of number 1 through 7 in order.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 12:52 AM
  • Max - you are not really explaining what you are trying to accomplish.  Forget about code and control arrays.  What is it the you are trying to do on a user form?

    Nothing is this difficult - I suspect your approach is misguided.


    ¯\_(ツ)_/¯

    Hi JRV,

    I've got a UserForm with 7 TextBoxes and a ComboBox.  My goal is to copy text from those fields into a new Outlook email.  I've got working code now but it uses a For Each loop but will copy the text in that precise order and I'm looking to set the order of the text myself.

    Here is my first attempt which works just not in the order which creates a warm and fuzzy feeling.

    Private Sub CommandButton4_Click()
    Dim OutlookApp As Object
    Dim mItem As Object
    Dim GetClip As New DataObject
    Dim ctrl As Control, sText As String
    
    Set OutlookApp = CreateObject("Outlook.Application")
    Set mItem = OutlookApp.CreateItem(0)
        sText = ""
    For Each ctrl In Me.Controls
            If TypeName(ctrl) = "TextBox" Or _
                TypeName(ctrl) = "ComboBox" Then
                sText = sText & ctrl.Text & vbCrLf
                End If
            Next ctrl
        With GetClip
            .SetText sText
            .PutInClipboard
        End With
    Set GetClip = Nothing
    With mItem
        .To = "PlaceHolder"
        .Subject = "PlaceHolder!"
        .Body = "PlaceHolder" & vbCrLf & (sText)
        .Display
        End With
    Set ctrl = Nothing
    End Sub

    Tuesday, July 29, 2014 1:19 AM
  • The trouble starts when you want to add another type of control within the other controls.  I've searched for a few days but haven't found any code that will copy the .Text property in an arbitrary fashion, for example as seen below.  *I know macros working directly with the Spreadsheet instead of the UserForm would work over 9,000 times better (sorry for the Dragon Ball Z reference) but its one of my design constraints.

    Consider:

    TextBox1
    ComboBox1
    TextBox2
    TextBox3
    TextBox4
    TextBox5
    TextBox6
    TextBox7

    Tuesday, July 29, 2014 1:31 AM
  • The trouble starts when you want to add another type of control within the other controls.  I've searched for a few days but haven't found any code that will copy the .Text property in an arbitrary fashion, for example as seen below.  *I know macros working directly with the Spreadsheet instead of the UserForm would work over 9,000 times better (sorry for the Dragon Ball Z reference) but its one of my design constraints.

    Consider:

    TextBox1
    ComboBox1
    TextBox2
    TextBox3
    TextBox4
    TextBox5
    TextBox6
    TextBox7

    Place only the textboxes in a frame.  The frame has a controls collection.  Only the textboxes will be in that collection.  THe frame can be set to be hidden if you want.

    Using Form is a bit tricky until you understand how and why the form and controls are designed the way they are.  Once you understand this programming the form because very simple.  If anything takes more tha a couple of lines of code you have not designed the form correctly or understood how to use the events.

    Be patient.  I have trained well seasoned programmers in programming Windows forms.  They go through the same era of disbelief then eventually it makes sense to them.  Programming Windows Forms requires a paradigm shift in thinking.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 1:38 AM
  • Note I am addressing your issue with forms.  I know nothing about dragons or putzing with spreadsheet issues.  Solve the simple issue until you understand how it works.  Once you understand then you will be able to more easily address the rest of your issues.

    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 1:40 AM
  • Here is a full demo form that you can import into Excel and test with:

    FRM - http://1drv.ms/UyCStJ

    FRX - http://1drv.ms/UyCStJ

    Place in folder and Import into VBA editor.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 1:51 AM
  • Ok, let me step back a bit.  I'm no programmer, scripter or developer.  My IT background is on the support side.

    I'm not sure I follow the logic jrv.  If I've got 7 TextBoxes in a Frame, where does that leave the ComboBox?

    Right now, I have a UserForm, a Frame and in that Frame 7 TextBoxes and a ComboBox.

    I tried to import the FRM file into a new blank Spreadsheet but it fails with :Line 8: Property OleObjectBlob in UserForm1 had an invalid file reference. Then says Out of Memory.

    Tuesday, July 29, 2014 3:38 AM
  •   If I've got 7 TextBoxes in a Frame, where does that leave the ComboBox?

    Right now, I have a UserForm, a Frame and in that Frame 7 TextBoxes and a ComboBox.

    Why is the combobox inside of the frame? I didn't say anything about putting anything in the frame but the 7 textboxes. Look at the example that I posted above. It shows you how it all works.  Do you see that the ComboBox is NOT in the frame?

    Programmer is not the issue; "Thinker" is the issue.  Think about what is happening.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 4:06 AM
  • The ComboBox is inside the frame simple as an aesthetic design principle.  I want to mention I really appreciate the assistance jrv, without asking for help online I'd be really at a loss.

    The reason I'm getting stuck here is I've got code which will copy the 8 controls however the order does not work for me.  I am just looking for a method to get the text in the order I want, not in the order of how the code is written.

    Now, I been poking the Object Browser in VBA, MSForms Control class has a Tag property as String.  Isn't there a way to loop through each controls Tag property then copy the .Text property to Clipboard?

    Tuesday, July 29, 2014 4:58 AM
  • The ComboBox is inside the frame simple as an aesthetic design principle.  I want to mention I really appreciate the assistance jrv, without asking for help online I'd be really at a loss.

    The reason I'm getting stuck here is I've got code which will copy the 8 controls however the order does not work for me.  I am just looking for a method to get the text in the order I want, not in the order of how the code is written.

    Now, I been poking the Object Browser in VBA, MSForms Control class has a Tag property as String.  Isn't there a way to loop through each controls Tag property then copy the .Text property to Clipboard?

    Why would you put the combo box inside of a frame that is intended to logically group a set of controls?

    You can try and reinvent Windows all you want . Clearly 30 years of programming Windows forms is no match for your experience as a support tech so I will leave you to muddle through this difficult scientific problem.

    I hope your esthetics are more help then your technical skills.

    Sorry I wasted your time.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 5:07 AM
  • Jrv, let's take a step back.  I have no clue why I used a frame.  I do not have years of programming knowledge to rely on.  Please, tell me if there is a better way to accomplish what I set out to accomplish.

    Here is the spreadsheet I've been working on.  http://1drv.ms/1rW82YZ

    The controls are displayed according to a template so that is how I organized the form.

    *I mentioned my background as something to keep in mind, I don't have years of programming experience so things you or another person with programming experience might take for granted, I have no idea about.


    -Edit, here's a link to the folder http://1drv.ms/1rWbfrq
    • Edited by MaxFLipz Tuesday, July 29, 2014 6:35 AM add new link
    Tuesday, July 29, 2014 6:27 AM
  • Thank you for the suggestion, but it seems to have frozen the excel UserForm. 

    I have modified your file, IMHO this is what you want to accomplish, works on Win7 and Office 2010.

    https://dl.dropboxusercontent.com/u/35239054/Samples/41a7973f-cae4-4bdf-ab07-b46d9adebe6e.xlsm

    Andreas.

    • Marked as answer by MaxFLipz Tuesday, August 5, 2014 4:53 AM
    Tuesday, July 29, 2014 10:05 AM
  • Jrv, let's take a step back.  I have no clue why I used a frame.  I do not have years of programming knowledge to rely on.  Please, tell me if there is a better way to accomplish what I set out to accomplish.

    Here is the spreadsheet I've been working on.  http://1drv.ms/1rW82YZ

    The controls are displayed according to a template so that is how I organized the form.

    *I mentioned my background as something to keep in mind, I don't have years of programming experience so things you or another person with programming experience might take for granted, I have no idea about.


    -Edit, here's a link to the folder http://1drv.ms/1rWbfrq

    It is not possible to understand what you are asking.  YOU are saying that the combobox is also included in the desired output?  If so then I don't see the problem.  Just gather the contents in the order the controls are arranged in the frame.  Your workbook does not have a frame so you will get all controls on the form.

    In the case of your form the easiest thing to do is to just concatenate all text by name as you want it to appear.  Rename the controls sos they make sense and gather the text.

    Here is an example (using your workbook) of how we would gather and format fields for use elsewhere.  It has nothing to do with arrays and can really only be done by following basic design principals for WinForm layout, naming and data gathering. 

    Open the workbook and click your "GO" button.  Click the "Copy" and watch the output appear.  Analyze the very simple code to see how this is accomplished.

    http://1drv.ms/1rMHpY1


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 12:35 PM
  • Thank you for the suggestion, but it seems to have frozen the excel UserForm. 

    I have modified your file, IMHO this is what you want to accomplish, works on Win7 and Office 2010.

    https://dl.dropboxusercontent.com/u/35239054/Samples/41a7973f-cae4-4bdf-ab07-b46d9adebe6e.xlsm

    Andreas.

    Andreas code works too although it is the hard way to manage form data. Using names for objects is both clear and unambiguous. It is the better of all methods for managing forms.

    I see many non-programmers and those who are not formally trained in Office development using arrays and other subtle tricks.  While these work they actually make overall management of forms much harder.  Inventing methods because you do not want to take the time to learn the system can get you into trouble and creates a nightmare for those who may come later.

    Learning how to use userforms and VBA with the Office object model can make life very easy.  Not learning and just hacking will make every project as difficult as this one was.

    Avoid arrays in most cases.  Spend time with a good book on Office development.  You will be rewarded.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 12:44 PM
  • Using names for objects is both clear and unambiguous. It is the better of all methods for managing forms.

    Well, IMHO that it is a matter of opinion, every way to program something has advantages and disadvantages.

    In any case it has no disadvantages to show different solutions for the same problem. The OP can choose what he like.

    Andreas.

    Tuesday, July 29, 2014 1:40 PM
  • Using names for objects is both clear and unambiguous. It is the better of all methods for managing forms.

    Well, IMHO that it is a matter of opinion, every way to program something has advantages and disadvantages.

    In any case it has no disadvantages to show different solutions for the same problem. The OP can choose what he like.

    Andreas.

    In technology and in science it is not a matter of how pretty your are.  What is required is a good discipline for how to do things.  The concept that programming is somehow a simple artsy/fartsy way of seeing the world was abandoned two decades ago and seems to only persist today in the world of scripting.

    We do this in a program because they are reliable, repeatable and easy  to understand.  In this case adding an array or altering the tag adds no specific advantage over doing what is considered correct in forms design and that is to give the controls useful names.

    The case where we would use a different approach is where we are auto-generating an arbitrary number of controls like radio buttons or check boxes and wich to receive them as a tuple.  In this case using an array can be a help.

    Create a textbox and passing it to an array.  Loop through all creations.  Now you have an array that matches the order of generation and does not require subverting the tag property to enumerate eth controls.  The use of a frame accomplishes the same end and, in most cases, is preferred.

    I noted above that your method would work although it is messy and would be harder as we move along or make modifications to maintain.  Code maintenance and avoiding hidden errors and constructs are the first principles of programming.  We obtain this initially by creating a correct and robust design.  Not by using our favorite coding methods.

    Don't feel bad.  I have had many programmers make the same argument.  Almost all eventually realized that, in professional programming, there is no personal style.  All good programming shops dictate nearly all of the style that is used and critique all code by committee usually.  This is the only way to obtain predictable, testable and understandable code.  Follow the plan.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 2:11 PM
  • jrv, of course there is personal style in programming it’s called Easter Eggs. All
    joking aside, I had a look at both files and Andreas is correct. I'll explain what
    my purpose is for the Excel Form.

    The user fills in all the fields. I used a ComboBox to save a few seconds of typing the
    Ticket Status, you tell me if it's best left as a TextBox. I'll say my opinion
    there is anything to reduce the amount of typing is a good thing and it also
    reduces the chance of a typo. The button is pressed to get the text, open a new
    Outlook Mail and insert the text from the fields. The bonus is making the
    Ticket ID a hyperlink with the display text the Ticket ID.

    This email is a notification used to communicate the status of an outage. Extra bonus would
    be adding in a feature to the Excel Form that will popup a reminder after 1
    hour elapses from sending the 1st email to send an hourly update.

    ***Edit

    Thinking a little more critically with regards to this problem, I have NO idea why I wanted to pass a variable comprised of the text from 7 TextBoxes AND a ComboBox that was sorted arbitrarily to a new Outlook email.

    So I thought of another VERY SIMPLE way to accomplish this.  Just stack the .Text property in the desired order of the Body field for the new email.

    Private Sub CommandButton6_Click()
      Dim OutlookApp As Object
      Dim mItem As Object
      Dim sText As String
    
      Set OutlookApp = CreateObject("Outlook.Application")
      Set mItem = OutlookApp.CreateItem(0)
      With mItem
        .To = "PlaceHolder"
        .Subject = "PlaceHolder"
        .Body = TextBox1.Text & vbCrLf & ComboBox1.Text _
        & vbCrLf & TextBox2.Text & vbCrLf & TextBox3.Text _
        & vbCrLf & TextBox4.Text & vbCrLf & TextBox5.Text _
        & vbCrLf & TextBox6.Text & vbCrLf & TextBox7.Text
        .Display
      End With
    End Sub

    • Edited by MaxFLipz Tuesday, July 29, 2014 10:57 PM Add simple method
    Tuesday, July 29, 2014 10:33 PM
  • If you had even bothered to look at the example I posted much earlier you would have seen that and much more.


    ¯\_(ツ)_/¯

    Tuesday, July 29, 2014 11:30 PM
  • If you had even bothered to look at the example I posted much earlier you would have seen that and much more.


    ¯\_(ツ)_/¯

    JRV, I did.  I wasn't sure why another text box named txtMessage was added seemingly in place of opening a new Outlook email where the text would be inserted.  In the file Andreas provided the functionality from the original spreadsheet was preserved.  Again I will say I am no programmer.  I really appreciate the programming lessons and design principles.  I'm afraid that is beyond the scope of my posting here.

    So can we agree the answer here is to not use a variable when trying to insert text off a UserForm into a new Outlook email instead stack the control's .Text property in the desired order and call it done.

    Tuesday, July 29, 2014 11:57 PM
  • I am sorry I tried.  You apparently cannot understand what I posted and why so I just wasted time.

    You can do whatever you like  I was only trying to show you how to use forms in a way that will prevent you from getting boxed into corners.  I guess it is not possible.

    Do what you like.


    ¯\_(ツ)_/¯

    Wednesday, July 30, 2014 12:11 AM
  • Just wanted to come back and wrap this question up.  Andreas Killer was closest to the solution but ultimately JRV suggested keeping things simple so I ended up with a button that puts text from 7 TextBoxes and a ComboBox into an email arranged in a table in the desired order.

    Private Sub CommandButton6_Click()
      Dim OutlookApp As Object
      Dim mItem As Object
      Dim MyLink As String, MyText As String, MyFooter As String
    MyLink = "Http://YourOwnURLGoesHere.com/?="
    MyText = "Text in email.<BR><BR>"
    MyFooter = "Footer text in email."
        Set OutlookApp = CreateObject("Outlook.Application")
        Set mItem = OutlookApp.CreateItem(0)
        With mItem 'Note TextBox1.Value is text entered by the user.
        .SentOnBehalfOfName = "Some@Email.com"
        .To = "SomeoneElse@Email.com"
        .Subject = ""
        .HTMLBody = "<HTML><BODY><H2><I>"
        .HTMLBody = .HTMLBody & "<P Style=""font-family:Arial;font-size:18pt;color:red;"">SomeText"
        .HTMLBody = .HTMLBody & "<Span Style=""Color:RGB(31,73,125);"">MoreText</SPAN></H2></P>"
        .HTMLBody = .HTMLBody & "<Span Style='font-family:Arial;font-size:12pt;Color:blue'>" & MyText & "</SPAN></I>"
        .HTMLBody = .HTMLBody & "<table style=""font-family: Arial; font-size: 10pt; text-align: left;"" border=""0""" & _
            "cellpadding=""1"" cellspacing=""10"">" & "<TDBODY>" & "<TR>" & _
            "<TD Style=""font-weight: bold; width: 400px;"">CellA1</TD>" & _
            "<TD Style=""width: 300px""><a href=""" & MyLink & _
            TextBox1.Value & """>" & TextBox1.Value & "</a></TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">CellB1</SPAN></TD>" & "<TD><B>" & ComboBox1.Text & "</B></TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">CellC1</SPAN></TD>" & "<TD>" & TextBox2.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">Impact Summary:</SPAN></TD>" & "<TD>" & TextBox3.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">Locations Impacted:</SPAN></TD>" & "<TD>" & TextBox4.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">Incident Manager:</SPAN></TD>" & "<TD>" & TextBox5.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">Recovery:</SPAN></TD>" & "<TD>" & TextBox6.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;"">Root Cause:</SPAN></TD>" & "<TD><B>" & TextBox7.Text & "</B></TD>" & "</TR>" & "</TABLE><BR><BR><I><Span Style='font-family:Arial;font-size:9pt;Color:red'>" & MyFooter & "</I></BODY></HTML>"
        .Importance = 2
        .Display
      End With
    End Sub


    • Edited by MaxFLipz Monday, August 4, 2014 8:54 PM
    Monday, August 4, 2014 8:52 PM