How do I display a quote?
Everytime I've tried, I've terminated the openquote too early or commented out the closequote. 8)
Printable View
How do I display a quote?
Everytime I've tried, I've terminated the openquote too early or commented out the closequote. 8)
Use either 2 quote marks together or Chr$(34). I.E.:
Msgbox """"
- or -
Msgbox Chr$(34)
Thanks! One more question: How do I take text from a textbox and insert it into a text file? I've already taken care of the file opening and closing, I just need to know how to append the textbox info into it.
I prefer Chr$(34). """" gets a little too confusing....
Use this:
Print# 1, Text1.Text
do you want to open it for Append(add to) or Output(overwrite)?
Code:Private Sub Command1_Click()
'append(add to)
Open "c:\text.txt" For Append As #1
Print #1, Text1.Text
Close #1
'output(overwrite)
Open "c:\text.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
Hehe. You forgot your [ /code ], I think.
To append text from a textbox to a file, you must use either the Write or the Print statement. Write will enclose the text in quotes, Print will not (you probably want Print).
Example:
Code:Open "C:\Whatever\MyFile.txt" For Append As #1
Print #1, txtWhatever.Text
Close #1
Here's what I'm working with.
On the line that says 'objMessage.Text = "-----"', I could insert the information itself from the textboxes, or I could put a brief message here and add an attachment containing a file with the info. Which would be more efficient, and how would I do it?Code:Private Sub cmdPlaceorder_Click()
Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
'Create the Session Object
Set objSession = CreateObject("mapi.session")
'Logon using the session object
'Specify a valid profile name if you want to
'Avoid the logon dialog box
'objSession.Logon profileName:="MS Exchange Settings"
objSession.Logon profileName:="Novell Default Settings"
'Add a new message object to the OutBox
Set objMessage = objSession.Outbox.Messages.Add
'Set the properties of the message object
objMessage.subject = "ECLS Order"
objMessage.Text = "-----"
'Add a recipient object to the objMessage.Recipients collection
Set objRecipient = objMessage.Recipients.Add
'Set the properties of the recipient object
objRecipient.Name = "[email protected]" '<---Replace this with a valid
'display name or e-mail alias
'objRecipient.Type = mapiTo
objRecipient.Resolve
'Send the message
objMessage.Send showDialog:=False
MsgBox "Order placed successfully!"
'Logoff using the session object
objSession.Logoff
End Sub
P.S. - Yes, I did get this code from a vb site.
Sorry for bringing this back up in the list, but I really need to figure this out soon!