N
Nick Ward
Hi
I have a function that generates a customer quotation in MS Word. It also
inserts a picture of my choosing into a bookmark in the word template:
If Not IsNull(Forms!frm_quote![SuggestedImage]) Then
m_objWord.ActiveDocument.Bookmarks("picy").Select
m_objWord.Selection.InlineShapes.AddPicture FileName:= _
recSupps("suggestedImage") _
, LinkToFile:=False, SaveWithDocument:=True
End If
This all work swimmingly well except that I have encountered a problem when
I have some code that generates a quote and then attaches it to an email.
Its attaching the word doc without the image! so I get the quote generated
missing the jpg.
Was wondering if anyone has come across this before as its really annoying
as I have to manually attach the quote to the email to get over this problem
strOrder = "Dear " & recSupps("Salutation") & _
vbCrLf & vbCrLf & _
"Many thanks for your enquiry please find your quote attached
to this email." & _
vbCrLf & vbCrLf & _
"Kind Regards" & _
vbCrLf & vbCrLf & _
"Nick Ward"
If Not IsNull(recSupps("Email")) Then
Set objMessage = objOutlook.CreateItem(olMailItem)
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItems = myInbox.Items
Set mydestfolder = myInbox.Folders("quotes to be sent")
With objMessage
.BodyFormat = olFormatRichText
.Importance = olImportanceHigh
.To = recSupps("Email")
.Subject = "Requested Quote"
.Body = strOrder
.Attachments.Add M_strDIRSave & m_objDoc
.Save
.Move mydestfolder
End With
End If
m_objDoc.Close
m_objWord.Quit
Set m_objDoc = Nothing
Set m_objWord = Nothing
requerynotesform
I have a function that generates a customer quotation in MS Word. It also
inserts a picture of my choosing into a bookmark in the word template:
If Not IsNull(Forms!frm_quote![SuggestedImage]) Then
m_objWord.ActiveDocument.Bookmarks("picy").Select
m_objWord.Selection.InlineShapes.AddPicture FileName:= _
recSupps("suggestedImage") _
, LinkToFile:=False, SaveWithDocument:=True
End If
This all work swimmingly well except that I have encountered a problem when
I have some code that generates a quote and then attaches it to an email.
Its attaching the word doc without the image! so I get the quote generated
missing the jpg.
Was wondering if anyone has come across this before as its really annoying
as I have to manually attach the quote to the email to get over this problem
strOrder = "Dear " & recSupps("Salutation") & _
vbCrLf & vbCrLf & _
"Many thanks for your enquiry please find your quote attached
to this email." & _
vbCrLf & vbCrLf & _
"Kind Regards" & _
vbCrLf & vbCrLf & _
"Nick Ward"
If Not IsNull(recSupps("Email")) Then
Set objMessage = objOutlook.CreateItem(olMailItem)
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItems = myInbox.Items
Set mydestfolder = myInbox.Folders("quotes to be sent")
With objMessage
.BodyFormat = olFormatRichText
.Importance = olImportanceHigh
.To = recSupps("Email")
.Subject = "Requested Quote"
.Body = strOrder
.Attachments.Add M_strDIRSave & m_objDoc
.Save
.Move mydestfolder
End With
End If
m_objDoc.Close
m_objWord.Quit
Set m_objDoc = Nothing
Set m_objWord = Nothing
requerynotesform