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

Problem of sending content with links in Word to Outlook



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old December 4th 07, 11:13 AM posted to microsoft.public.outlook.program_vba
lee
external usenet poster
 
Posts: 66
Default Problem of sending content with links in Word to Outlook

I have a word file with VBA to save the content to Draft in Outlook. It works
but the link in the content change to text rather than link even if it is
actually a link in Word and I have set the mail format to HTML in Outlook. I
find the end of each line in the draft mail contain a space and the link
recovers if I delete the ending space. Grateful if you can help with the
following word VBA.

Private Sub CreateOutlookMessage()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem

On Error GoTo ErrorMsgs

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olDraftItem)
With objOutlookMsg
.To = "
.Subject = "test"
.BodyFormat = olFormatHTML
.Body = ActiveDocument.Content
.Save
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing
Set objOutlookAttach = Nothing
Exit Sub

ErrorMsgs:
If Err.Number = "287" Then
MsgBox "You clicked No to the Outlook security warning. " & _
"Rerun the procedure and click Yes to access e-mail" & _
"addresses to send your message. For more information, " & _
"see the document at http://www.microsoft.com/office" & _
"/previous/outlook/downloads/security.asp. "
End If
End Sub
 




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
Extract word document content and save in MS Access Raju A[_2_] Outlook and VBA 0 September 3rd 07 11:50 AM
Extract word document content and save in MS Access. Raju A[_2_] Outlook and VBA 0 September 3rd 07 11:50 AM
Currently opened document content from word/ppt/Excel ? Malleswar Outlook - Using Forms 0 July 18th 07 04:58 PM
Word attachments go to Content.IE5 folder PeggyN Outlook Express 9 March 26th 07 08:36 PM
Problem in getting the content of email Danish Outlook Express 1 April 26th 06 08:46 PM


All times are GMT +1. The time now is 08:56 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.