Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 3rd, 2004, 09:16 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default Bold Words in Strings

No, I'm not going to tell someone off. :D

I'm using the DoCmd.SendObject method to write an e-mail message to someone and was wondering if there's a way to bold one word out of a sentence. For example, this does not work, but it'll give you an idea of what I want.

strEmailMsg = "PSM No. " & Format(Me.txtPSMNo, "[Bold]") & " was assigned..."

So in the e-mail message, you'd see

PSM No. PSM-2004-0001 was assigned...

Is there a way? My e-mail client is Novell GroupWise.

Thanks!


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
Reply With Quote
  #2 (permalink)  
Old September 8th, 2004, 02:41 PM
Authorized User
 
Join Date: Aug 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SerranoG

I to have problems with the VBA code for bold. I came to the conclusion that words do not want to be bolded in VBA code. ;) J/K but I did find this page that discussed making a box and making the border darder. the code reads something like this
Private Sub Report_Page()
       On Error Resume Next
         ' Set Thickness and Border Style
         Me.DrawWidth = 6 ' larger number, thicker line
         Me.DrawStyle = 0 ' 0 to 6 = solid to invisible

         ' object.Line (x1, y1) - (x2,y2), color, [Box=B]
         Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), vbGreen, B
       End Sub

maybe the characters and formating in bold has something to do with the draw style or width. I don't know if this is helpful.

Reply With Quote
  #3 (permalink)  
Old September 15th, 2004, 08:46 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If your email client allows for formatting as html then it is fairly easy to add colors, bold italic etc... I am only familiar with ms outlook but here is an example...

Sub CreateHTMLMail()
'Creates a new e-mail item and modifies its properties.

    Dim olApp As Outlook.Application
    Dim objMail As Outlook.MailItem
    Set olApp = Outlook.Application
    'Create e-mail item
    Set objMail = olApp.CreateItem(olMailItem)

    With objMail
       'Set body format to HTML
       .BodyFormat = olFormatHTML
       .HTMLBody = "<HTML><H2>The body of this message will appear in HTML.</H2><BODY><P>Enter the <B>message</B> text here. </P></BODY></HTML>"
       .Display
    End With
End Sub

message in the above example would be bold....
Hope this helps.

Reply With Quote
  #4 (permalink)  
Old September 15th, 2004, 11:23 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Greg,
I am not sure if this will work:

strEmailMsg = "PSM No. <B>" & Me.txtPSMNo & "</B> was assigned..."

or

strEmailMsg = "PSM No. &lt;B&gt;" & Me.txtPSMNo & "&lt;/B&gt; was assigned..."

John
Reply With Quote
  #5 (permalink)  
Old September 21st, 2004, 10:54 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

John,

No go... both ways are taken literally.

Changing the e-mail type to HTML as FlatHead suggests would probably fix it, however, everyone's default e-mail view here is set to plain text. The only ones who would see it are those VERY few who set it otherwise. I'll just leave it as is...

Thanks for your suggestions.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #6 (permalink)  
Old September 23rd, 2004, 05:20 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try this instead:

strEmailMsg = "PSM No. <B>'" & Me.txtPSMNo & "'</B> was assigned..."

or

strEmailMsg = "PSM No. <B>""" & Me.txtPSMNo & """</B> was assigned..."



John
Reply With Quote
  #7 (permalink)  
Old September 24th, 2004, 06:46 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

No, that will only work if the user's mailbox is defaulted to accept mail in HTML format. Almost everyone here is set for plain text.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a bold word in a selected sentence Birger XSLT 4 January 1st, 2007 07:02 PM
Pivot Subtotals in Bold paul20091968 Excel VBA 0 June 29th, 2006 07:03 AM
Bold fonts in JTextPane hary Java GUI 1 August 1st, 2005 06:22 PM
making a link bold knalle HTML Code Clinic 5 November 12th, 2004 11:46 AM



All times are GMT -4. The time now is 02:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.