R
Raj
Dear ALL,
I would like to send an email to a person and then print the same on a
netwrok printer. I managed to do the email part but not aware of doing the
print part.
Below is the code i am using for sending an email:
Can anybo help me with the printing part?
Thanks in advance!
-Raj.
strHTML = "<body bgcolor = #FFF8DC><h4>Attn Project Manager: " &
ProjMgr.Value & "</h4>"
Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
'Create the message object
Set iMsg = CreateObject("CDO.Message")
'Create the configuration object
Set iConf = iMsg.Configuration
'Set the fields of the configuration object to send using SMTP via port
25.
With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
strSmartHost
.Update
End With
With iMsg
.To = quote & projectmanager & quote
.From = quote & init & quote ' & initname & quote '
.Subject = "MupID: " & ItemNo.Value &
.HTMLBody = strHTML
.AddAttachment "C:\Program Files\frmLogin.MAF"
.Send
I would like to send an email to a person and then print the same on a
netwrok printer. I managed to do the email part but not aware of doing the
print part.
Below is the code i am using for sending an email:
Can anybo help me with the printing part?
Thanks in advance!
-Raj.
strHTML = "<body bgcolor = #FFF8DC><h4>Attn Project Manager: " &
ProjMgr.Value & "</h4>"
Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
'Create the message object
Set iMsg = CreateObject("CDO.Message")
'Create the configuration object
Set iConf = iMsg.Configuration
'Set the fields of the configuration object to send using SMTP via port
25.
With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
strSmartHost
.Update
End With
With iMsg
.To = quote & projectmanager & quote
.From = quote & init & quote ' & initname & quote '
.Subject = "MupID: " & ItemNo.Value &
.HTMLBody = strHTML
.AddAttachment "C:\Program Files\frmLogin.MAF"
.Send