How do I add myself an avatar from the public avatar library?
ASP to Word send by ObjSendMail ??
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programming > ASP to Word send by ObjSendMail ?? 31 August 2008 17:25:30

  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

ASP to Word send by ObjSendMail ??

Jerry Yang 31 August 2008 17:25:30
 Hi

I can get the data I need from my DB and show it on screen fine.

One user has asked if I can have an option when the submits his new
data to the DB, instead of it emailing him a plain text or html email,
(as it does now) could it send a copy of the data as a word doc.

Can any one help ??

Server is windows 2003

Thanks
Add comment
Adrienne Boswell 28 August 2008 11:52:10 permanent link ]
 Gazing into my crystal ball I observed Jerry Yang <jexxtexx@gmail.com­>
writing in news:b692a69c-2866-­4f4e-945f-98696c3228­0b@
56g2000hsm.googlegr­oups.com:

Hi
I can get the data I need from my DB and show it on screen fine.
One user has asked if I can have an option when the submits his new
data to the DB, instead of it emailing him a plain text or html email,
(as it does now) could it send a copy of the data as a word doc.
Can any one help ??
Server is windows 2003
Thanks

Google is your friend. There are plenty of examples. Google for asp
word.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcad­e-of-coding.info
Please respond to the group so others can share

Add comment
Anthony Jones 28 August 2008 11:57:43 permanent link ]
 "Jerry Yang" <jexxtexx@gmail.com­> wrote in message
news:b692a69c-2866-­4f4e-945f-98696c3228­0b@56g2000hsm.google­groups.com...
Hi
I can get the data I need from my DB and show it on screen fine.
One user has asked if I can have an option when the submits his new
data to the DB, instead of it emailing him a plain text or html email,
(as it does now) could it send a copy of the data as a word doc.
Can any one help ??

What the user is asking for is far from a trivial change.

As long as you are sending nicely formatted HTML may advice would be to say
to the user "No sorry I can't do that" and see what happens.


--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Jerry Yang 29 August 2008 20:15:51 permanent link ]
 Hi
I have googled this, but can't seem to find what I'm looking for and
this users is the boss !!

So I've got to try and sort something !!

any other ideas ?

thanks
Add comment
Anthony Jones 29 August 2008 21:32:19 permanent link ]
 "Jerry Yang" <jexxtexx@gmail.com­> wrote in message
news:dc2019f7-57a5-­4f16-b628-7aeee162ac­d8@d77g2000hsb.googl­egroups.com...
Hi
I have googled this, but can't seem to find what I'm looking for and
this users is the boss !!
So I've got to try and sort something !!

Since its the boss and not a customer or anyone else important you could
probably get away with using HTML and pretending its a word doc.

Option Explicit

Const cdoSendUsingMethod =
"http://schemas.mic­rosoft.com/cdo/confi­guration/sendusing"
Const cdoSMTPServer =
"http://schemas.mic­rosoft.com/cdo/confi­guration/smtpserver"­
Const cdoSMTPServerPickup­Directory =
"http://schemas.mic­rosoft.com/cdo/confi­guration/smtpserverp­ickupdirectory"
Const cdoSMTPServerPort =
"http://schemas.mic­rosoft.com/cdo/confi­guration/smtpserverp­ort"

Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2


Dim oMsg : Set oMsg = CreateObject("CDO.M­essage")
Dim oConfig : Set oConfig = CreateObject("CDO.C­onfiguration")

With oConfig.Fields
.Item(cdoSendUsingM­ethod) = cdoSendUsingPort
.Item(cdoSMTPServer­) = "mysmtp.myserver.co­m"
.Item(cdoSMTPServer­Port) = 25
.Update
End With

oMsg.From = "Me <me@mymail.myserver­.com>"
oMsg.To = "Bloke <boss@mymail.myserv­er.com>"
oMsg.Subject = "Test"
oMsg.HTMLBody = "<html><body>Hello World</body></html>­"
Set oMsg.Configuration = oConfig

Dim oPart : Set oPart = oMsg.Attachments.Ad­d

oPart.ContentMediaT­ype = "text/html;charset=­Windows-1252"
oPart.ContentTransf­erEncoding = "quoted-printable"
oPart.Fields("urn:s­chemas:mailheader:co­ntent-disposition") = "attachment;
filename=""test.doc­"""
oPart.Fields.Update­

Dim oStream : Set oStream = oPart.GetDecodedCon­tentStream

Dim sDoc : sDoc = "<html><body><h1>Th­is is a Header</h1><p>This is
content</p></body><­/html>"

oStream.WriteText sDoc
oStream.Flush

oMsg.Send


Ok so the attachment is really HTML but since the filename says its .doc its
word that opens it and word quite happily displays simple HTML.

--
Anthony Jones - MVP ASP/ASP.NET


Add comment
Jerry Yang 31 August 2008 17:25:30 permanent link ]
 Cheers that works well :)­

Should keep him off my back for a while !!
THANKS
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programming > ASP to Word send by ObjSendMail ?? 31 August 2008 17:25:30

see also:
GET MORE FOR YOUR BUCK
How to connect Web databse from Local…
Not inserting into MySQL table and not…
пройди тесты:
see also:
Hh, it is fast in school. I do not ...
Hi! Why this site is so empty?:'(
Hi People!

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .