A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need help with 2 HTML files in the body of an email using excel co



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 27th 06, 08:57 AM posted to microsoft.public.outlook.program_vba
Trefor
external usenet poster
 
Posts: 27
Default Need help with 2 HTML files in the body of an email using excel co

I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor
Ads
  #2  
Old November 27th 06, 01:22 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Need help with 2 HTML files in the body of an email using excel co

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor

  #3  
Old November 27th 06, 03:15 PM posted to microsoft.public.outlook.program_vba
Trefor
external usenet poster
 
Posts: 27
Default Need help with 2 HTML files in the body of an email using exce

Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
..HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor


  #4  
Old November 27th 06, 03:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Need help with 2 HTML files in the body of an email using exce

Ah, I see. (Apparently I need that 2nd cup of coffee.) So what do those files look like? Remember you can't just slap two HTML files together. A valid HTML body can have only one set of html and body tags.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor


  #5  
Old November 27th 06, 04:41 PM posted to microsoft.public.outlook.program_vba
Trefor
external usenet poster
 
Posts: 27
Default Need help with 2 HTML files in the body of an email using exce

Sue,

The Signature file reads in my actual Outlook Signature file created in
Outlook. The "BodyFile" is simply a file that I created using Word and then
saved it as an HTML file. If this was the wrong this to do, how should I
create the Body file and/or can I edit these files to make them work?

--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

Ah, I see. (Apparently I need that 2nd cup of coffee.) So what do those files look like? Remember you can't just slap two HTML files together. A valid HTML body can have only one set of html and body tags.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor


  #6  
Old November 27th 06, 05:30 PM posted to microsoft.public.outlook.program_vba
Trefor
external usenet poster
 
Posts: 27
Default Need help with 2 HTML files in the body of an email using exce

Sue,

OK perhaps I should state I know nothing about HTML, so

"Remember you can't just slap two HTML files together." Actually I had no
idea that you could not do this.

"A valid HTML body can have only one set of html and body tags.". On my
steep learning curve I have managed to open the HTML source of both files.
Your statement now makes a little more sense. Both files to have these tags,
can I just remove them from my bodyfile?

Another stupid question, sorry, does it matter how I saved this file from
word, I used Save As "Web Page (*.htm; *.html)"


--
Trefor


"Trefor" wrote:

Sue,

The Signature file reads in my actual Outlook Signature file created in
Outlook. The "BodyFile" is simply a file that I created using Word and then
saved it as an HTML file. If this was the wrong this to do, how should I
create the Body file and/or can I edit these files to make them work?

--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

Ah, I see. (Apparently I need that 2nd cup of coffee.) So what do those files look like? Remember you can't just slap two HTML files together. A valid HTML body can have only one set of html and body tags.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor


  #7  
Old November 28th 06, 12:37 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Need help with 2 HTML files in the body of an email using exce

It all matters. This isn't really the place for an HTML 101 tutorial, I'm afraid, but you're on the right track.

Both files to have these tags,
can I just remove them from my bodyfile?


Think about it. You have looked at the source for two valid HTML files now. What do they have in common? If you take out some tags from the one file and then concantenate it with the other, will you still have a valid HTML file with the same structure as the files you have now? If necessary, use Notepad to make some small HTML files that are more readable than what Word puts out.

Your goal is to figure out what part of one file you need to put together with what part of the other file in order to have valid HTML. Once you understand that, a few snips with Replace() should do the trick.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
Sue,

OK perhaps I should state I know nothing about HTML, so

"Remember you can't just slap two HTML files together." Actually I had no
idea that you could not do this.

"A valid HTML body can have only one set of html and body tags.". On my
steep learning curve I have managed to open the HTML source of both files.
Your statement now makes a little more sense. Both files to have these tags,
can I just remove them from my bodyfile?

Another stupid question, sorry, does it matter how I saved this file from
word, I used Save As "Web Page (*.htm; *.html)"


--
Trefor


"Trefor" wrote:

Sue,

The Signature file reads in my actual Outlook Signature file created in
Outlook. The "BodyFile" is simply a file that I created using Word and then
saved it as an HTML file. If this was the wrong this to do, how should I
create the Body file and/or can I edit these files to make them work?

--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

Ah, I see. (Apparently I need that 2nd cup of coffee.) So what do those files look like? Remember you can't just slap two HTML files together. A valid HTML body can have only one set of html and body tags.



"Trefor" wrote in message ...
Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor


  #8  
Old January 11th 07, 05:28 AM posted to microsoft.public.outlook.program_vba
Trefor
external usenet poster
 
Posts: 27
Default Need help with 2 HTML files in the body of an email using exce

Sue, Sorry for ther late reply. Many thanks for your reply, but my HTML
skills are ZERO. I had a look at the HTML and yes I can see the gist of the
issue, but to fix it is another issue altogether. Thanks anyway but I was
looking for a quick fix without having to reinvent the wheel.

--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

It all matters. This isn't really the place for an HTML 101 tutorial, I'm afraid, but you're on the right track.

Both files to have these tags,
can I just remove them from my bodyfile?


Think about it. You have looked at the source for two valid HTML files now. What do they have in common? If you take out some tags from the one file and then concantenate it with the other, will you still have a valid HTML file with the same structure as the files you have now? If necessary, use Notepad to make some small HTML files that are more readable than what Word puts out.

Your goal is to figure out what part of one file you need to put together with what part of the other file in order to have valid HTML. Once you understand that, a few snips with Replace() should do the trick.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trefor" wrote in message ...
Sue,

OK perhaps I should state I know nothing about HTML, so

"Remember you can't just slap two HTML files together." Actually I had no
idea that you could not do this.

"A valid HTML body can have only one set of html and body tags.". On my
steep learning curve I have managed to open the HTML source of both files.
Your statement now makes a little more sense. Both files to have these tags,
can I just remove them from my bodyfile?

Another stupid question, sorry, does it matter how I saved this file from
word, I used Save As "Web Page (*.htm; *.html)"


--
Trefor


"Trefor" wrote:

Sue,

The Signature file reads in my actual Outlook Signature file created in
Outlook. The "BodyFile" is simply a file that I created using Word and then
saved it as an HTML file. If this was the wrong this to do, how should I
create the Body file and/or can I edit these files to make them work?

--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

Ah, I see. (Apparently I need that 2nd cup of coffee.) So what do those files look like? Remember you can't just slap two HTML files together. A valid HTML body can have only one set of html and body tags.



"Trefor" wrote in message ...
Sue,

Thankyou for the reply.

"does nothing with Signature" Please note the variable at the end of the
line:
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" & Signature


Appoligies the GetBoiler is a routine from Dick Kusleika:

Function GetBoiler(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
--
Trefor


"Sue Mosher [MVP-Outlook]" wrote:

We have no way of knowing what GetBoiler does, but your code below does nothing with Signature after it sets the value of that variable. Apparently you need to concatenate it with the information from BodyFIle.

"Trefor" wrote in message ...
I did post this on the Excel forum, but did not get a reply, so thought I
might be able to get some help here?

I have tried to modify some code from Ron de Bruin site, but its not working.
I just get my signature and not the main body which comes from a file
"BodyFile". Any ideas?

SigString =
Workbooks(WorkbookMain).Sheets(DCSheet(Data%)).Ran ge("Data_SignaturePath").Value

If Dir(SigString) "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If

With OutMail
.To = ETo
.CC = Ecc
.BCC = EBcc
.Subject = ESubject
.HTMLBody = GetBoiler(AppPath & "\" & BodyFile) & "brbr" &
Signature
If EAttach "" Then .Attachments.Add EAttach
.Display
End With


--
Trefor



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding html and text files in an email template. Maria Outlook - General Queries 0 October 31st 06 11:32 PM
insert as text (to insert html into email body) Iona Outlook - General Queries 1 July 13th 06 01:10 PM
Adding HTML text to the email body for each recipient Tom at GSD Add-ins for Outlook 2 July 7th 06 12:25 AM
mailto - html in body Giorgio Outlook Express 7 June 21st 06 03:41 PM
sending html in body of outlook xp email Help a Novice Please Outlook - General Queries 3 February 22nd 06 07:50 AM


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.