Specify formatting of HTMLBody in and outlook message

Status
Not open for further replies.
T

Tigerfish

I have programmed a button on an Access form using VBA to automatically send

an Access report in HTML format as the body of an Outlook message. It works

as desired, keeping all the column formatting and spacing. The problem is

that long messages are truncated at the end of the first 'page' and have the

hyperlink paging buttons "First - Previous - Next - Last" at the bottom of

the message body. However, these links don't work and the report is just

truncated.

Is there any way to specify the size of the Outlook message body or turn the

paging hyperlinks off so that the entire report is included in the body of

the message. These reports are acknowledgement reports listing all materials

received for a project. They are rarely more than two report pages, but

often more than just one page.

In the past we have sent the reports as attachments but find that recipients

don't always open attachments. It would be great if we could send the

entire report in the body of the message instead.

Would appreciate any help.

Thanks.

Michelle
 
For either case you'd need to edit the raw HTML in what you send to Outlook

or directly in the HTMLBody property of the mail item.

"Tigerfish" <Tigerfish> wrote in message

news:9E39F7D1-7E34-4FCE-91B4-CB35D70ABC1E@microsoft.com...
> I have programmed a button on an Access form using VBA to automatically
> send
> an Access report in HTML format as the body of an Outlook message. It
> works
> as desired, keeping all the column formatting and spacing. The problem is
> that long messages are truncated at the end of the first 'page' and have
> the
> hyperlink paging buttons "First - Previous - Next - Last" at the bottom of
> the message body. However, these links don't work and the report is just
> truncated.

> Is there any way to specify the size of the Outlook message body or turn
> the
> paging hyperlinks off so that the entire report is included in the body of
> the message. These reports are acknowledgement reports listing all
> materials
> received for a project. They are rarely more than two report pages, but
> often more than just one page.

> In the past we have sent the reports as attachments but find that
> recipients
> don't always open attachments. It would be great if we could send the
> entire report in the body of the message instead.

> Would appreciate any help.

> Thanks.
> > Michelle
 
I apologize if my question was to vague. That's exactly what I need help

with. How do I edit the HTML or change the properties of HTML body so the

the report is not truncated. The reports are nowhere near as large as the

max size for an Outlook message. So I'm assuming there's some way to keep

Outlook from chopping off part of the message.

My code to create the HTML document from an Access report and send the email

is very simple.

stDocName = "rptConfirmTapesRecd"

stOutputDocName = code to create a document name

DoCmd.OutputTo acReport, stDocName, acFormatHTML, stOutputDocName

Set fs = CreateObject("Scripting.FileSystemObject")

Set f = fs.OpenTextFile(stOutputDocName, 1) 'Read in data from report

stHTMLBody = f.readall

f.Close

' Create the Outlook session

Set objOutlook = CreateObject("Outlook.Application")

' Create the message

Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg

Set objOutlookRecip = .Recipients.Add(stProjEmail)

objOutlookRecip.Type = olTo

If intResponse = 0 Then

> BodyFormat = olFormatHTML

> Subject = "Tapes received for transcription" & " - " &

[ProjName]

> HTMLBody = stHTMLBody

End If

> Display

End With

I've searched online and Outlook Help but can't find any more info on

changing HTMLbody properties.

Any ideas?

Michelle

"Tigerfish" wrote:


> I have programmed a button on an Access form using VBA to automatically send
> an Access report in HTML format as the body of an Outlook message. It works
> as desired, keeping all the column formatting and spacing. The problem is
> that long messages are truncated at the end of the first 'page' and have the
> hyperlink paging buttons "First - Previous - Next - Last" at the bottom of
> the message body. However, these links don't work and the report is just
> truncated.

> Is there any way to specify the size of the Outlook message body or turn the
> paging hyperlinks off so that the entire report is included in the body of
> the message. These reports are acknowledgement reports listing all materials
> received for a project. They are rarely more than two report pages, but
> often more than just one page.

> In the past we have sent the reports as attachments but find that recipients
> don't always open attachments. It would be great if we could send the
> entire report in the body of the message instead.

> Would appreciate any help.

> Thanks.
> > Michelle
 
HTMLBody is just a string you can retrieve from the email item. You get it

as a string and parse that string just as you would any other string, except

in this case you have to follow HTML formatting rules. No one here is going

to edit or write your HTML for you, you either have to be prepared to do

that or you need to hire someone who will do that for you.

"Tigerfish" <Tigerfish> wrote in message

news:272BEAFA-1185-4FCE-9C2C-3272DC48B3F5@microsoft.com...
> I apologize if my question was to vague. That's exactly what I need help
> with. How do I edit the HTML or change the properties of HTML body so the
> the report is not truncated. The reports are nowhere near as large as the
> max size for an Outlook message. So I'm assuming there's some way to keep
> Outlook from chopping off part of the message.

> My code to create the HTML document from an Access report and send the
> email
> is very simple.

> stDocName = "rptConfirmTapesRecd"
> stOutputDocName = code to create a document name

> DoCmd.OutputTo acReport, stDocName, acFormatHTML, stOutputDocName

> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.OpenTextFile(stOutputDocName, 1) 'Read in data from
> report
> stHTMLBody = f.readall
> f.Close

> ' Create the Outlook session
> Set objOutlook = CreateObject("Outlook.Application")

> ' Create the message
> Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

> With objOutlookMsg
> Set objOutlookRecip = .Recipients.Add(stProjEmail)
> objOutlookRecip.Type = olTo
> If intResponse = 0 Then
> .BodyFormat = olFormatHTML
> .Subject = "Tapes received for transcription" & " - " &
> [ProjName]
> .HTMLBody = stHTMLBody
> End If
> .Display
> End With

> I've searched online and Outlook Help but can't find any more info on
> changing HTMLbody properties.

> Any ideas?
> > Michelle
 
I'm not asking how to write html. My question is about the size of the

Outlook email message body. Is there a way to set the size of the body so

long messages, html or rtf or plain text, are not truncated when they are

added.

Perhaps I should re-post my question with a different title. My experience

programming for Outlook has been limited to creating an Outlooking session,

creating a mail item and sending it. My question must not be very clear.

Michelle
wrote:


> HTMLBody is just a string you can retrieve from the email item. You get it
> as a string and parse that string just as you would any other string, except
> in this case you have to follow HTML formatting rules. No one here is going
> to edit or write your HTML for you, you either have to be prepared to do
> that or you need to hire someone who will do that for you.

> >

>

> "Tigerfish" <Tigerfish> wrote in message
> news:272BEAFA-1185-4FCE-9C2C-3272DC48B3F5@microsoft.com...
> >I apologize if my question was to vague. That's exactly what I need help
> > with. How do I edit the HTML or change the properties of HTML body so the
> > the report is not truncated. The reports are nowhere near as large as the
> > max size for an Outlook message. So I'm assuming there's some way to keep
> > Outlook from chopping off part of the message.
> > My code to create the HTML document from an Access report and send the
> > email
> > is very simple.
> > stDocName = "rptConfirmTapesRecd"
> > stOutputDocName = code to create a document name
> > DoCmd.OutputTo acReport, stDocName, acFormatHTML, stOutputDocName
> > Set fs = CreateObject("Scripting.FileSystemObject")
> > Set f = fs.OpenTextFile(stOutputDocName, 1) 'Read in data from
> > report
> > stHTMLBody = f.readall
> > f.Close
> > ' Create the Outlook session
> > Set objOutlook = CreateObject("Outlook.Application")
> > ' Create the message
> > Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
> > With objOutlookMsg
> > Set objOutlookRecip = .Recipients.Add(stProjEmail)
> > objOutlookRecip.Type = olTo
> > If intResponse = 0 Then
> > .BodyFormat = olFormatHTML
> > .Subject = "Tapes received for transcription" & " - " &
> > [ProjName]
> > .HTMLBody = stHTMLBody
> > End If
> > .Display
> > End With
> > I've searched online and Outlook Help but can't find any more info on
> > changing HTMLbody properties.
> > Any ideas?
> > > > Michelle


>
 
If the entire message is contained within the <body> </body> tags of the

HTML it will not be truncated. Depending on the recipient's display size for

messages and for the screen they might have to scroll to see all the message

but it will be there.

"Tigerfish" <Tigerfish> wrote in message

news:64EAFA1C-01B5-4CCF-8F51-64F86EA1B40B@microsoft.com...
> I'm not asking how to write html. My question is about the size of the
> Outlook email message body. Is there a way to set the size of the body so
> long messages, html or rtf or plain text, are not truncated when they are
> added.

> Perhaps I should re-post my question with a different title. My
> experience
> programming for Outlook has been limited to creating an Outlooking
> session,
> creating a mail item and sending it. My question must not be very clear.
> > Michelle
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
David in Mississippi New (Feb 2020) install of Outlook 365 - Cannot specify PST for different accounts Using Outlook 0
H How can I specify which calendar to display Using Outlook 1
R specify from account in mail merge Using Outlook 3
J Specify Font Name or Face using VBA Macro in Word Outlook VBA and Custom Forms 2
D Re: How to specify the "current entry id" to GetItemFromID? Outlook VBA and Custom Forms 1
C View doesn't refresh (fields or formatting) Using Outlook 1
V Can one change the formatting of email title blocks? Using Outlook 0
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
K Outlook tasks formatting Using Outlook 4
E Conditional formatting - when current account <> received account ? Using Outlook 3
V Outlook Forms: Formatting a Label with 2 different styles Outlook VBA and Custom Forms 1
P BCM conditional formatting BCM (Business Contact Manager) 5
S Conditional Formatting for messages in a Conversation thread Using Outlook 1
S Conditional Formatting in calendar part of To-Do Bar Using Outlook 1
S Conditional formatting problem with "is not empty" and categories Using Outlook 2
N How to remove signature formatting from Text in Word (accidentally taken from Outlook) Using Outlook 0
K Conditional Formatting based on Department of person received from? Outlook VBA and Custom Forms 4
M Using conditional formatting on a shared calendar with categories Using Outlook 6
L Email to task without changin formatting Outlook VBA and Custom Forms 16
K Paste from Windows Clipboard then change font without losing formatting Outlook VBA and Custom Forms 1
C Change default colors for conditional formatting Using Outlook 2
Diane Poremsky Use Word Macro to Apply Formatting to Email Using Outlook 0
makinmyway How Prevent Re-Formatting of Contact Notes Field When Syncing Using Outlook 10
G outlook 13 copy & paste without losing formatting Using Outlook 1
D Outlook 2007 Formatting Using Outlook 1
D telephone formatting Contacts Using Outlook 2
D Conditional formatting - font sizes Using Outlook 3
A Lync meeting in outlook lose HTML formatting Using Outlook 3
A Help creating macro for conditional formatting settings Using Outlook 8
B Conditional Formatting:How to use >1 value in a filter Using Outlook 7
Copwriter Paragraph formatting in blank messages/stationery Using Outlook 3
V Report stuck formatting page Using Outlook 1
T The Formatting Changes When A Recurring Appointment is Changed Using Outlook 1
J Formatting Contacts to Export for iPhone Using Outlook 0
O How do I get rid of odd formatting of new e-mails? Using Outlook 3
A Using OR when organising with conditional formatting Using Outlook 1
G Outlook 2010 not formatting in-line comments Using Outlook 5
J Conditional Formatting Upon My Reply Using Outlook 1
W Outlook 2010 Share calendar but keep color formatting Using Outlook 2
Commodore Auto-formatting of certain phone numbers Using Outlook 2
B Ok - a complicated one - but really need help (auto formatting) Using Outlook 9
E Email Formatting - Tabs Using Outlook 1
A Need method to rapidly correct telephone contact telephone number formatting Using Outlook 1
N lose conditional formatting when importing to Outlook 2010 Using Outlook 2
H Formatting of email conversation print outs - URGENT Using Outlook 1
K Problems with message formatting for individual user Using Outlook 1
M Auto-correct Contact fields' formatting? Using Outlook 7
O Hyperlink formatting lost after replacement in outlook Using Outlook 5
O Hyperlink formatting lost after replacement in outlook Using Outlook 0
D Formatting Styles when Replying Using Outlook 10

Similar threads

Back
Top