PC Review
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Inserting a Picture
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Inserting a Picture
![]() |
Inserting a Picture |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
In Visual Basics I have my code that says:
Dim Notes As String Notes = ... I want to be able to say something like: Dim Picture As ? Picture = OLEPic What would I set the picture type as? Also how can I make change the font size and make it bold? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"Dan" wrote
> In Visual Basics I have my code that says: > > Dim Notes As String > Notes = ... > > I want to be able to say something like: > > Dim Picture As ? > Picture = OLEPic > > What would I set the picture type as? I assume you are, in fact, speaking about the Visual Basic for Applications that is used in Microsoft Access, the subject of this newsgroup. If not, then you need to ask your question in a newsgroup devoted to the (separate) Visual Basic language product. What is it that you intend to do with a Picture "object"? That's certainly not how we display pictures in Access. The sample imaging databases at http://accdevel.tripod.com illustrate three approaches to handling images in Access, and the download includes an article discussing considerations in choosing an approach. Two of the approaches do not use OLE Objects and, thus, avoid the database bloat associated with images in OLE Objects. If you are printing the images in reports, to avoid memory leakage, you should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm PrintFailure.zip is an Access97 MDB containing a report that fails during the Access formatting process prior to being spooled to the Printer Driver. This MDB also contains code showing how to convert the contents of the Image control to a Bitmap file prior to printing. This helps alleviate the "Out of Memory" error that can popup when printing image intensive reports. Larry Linson Microsoft Access MVP |
|
|
|
#3 |
|
Guest
Posts: n/a
|
in addition to Larry's answer:
if you are not sure about object type - you can always use Object. plus dont forget to add set when you reference objects: Dim Picture As object set Picture = OLEPic -- Alex Dybenko (MVP) http://Alex.Dybenko.com "Dan" <anonymous@discussions.microsoft.com> wrote in message news:729601c3e79e$f5e720c0$a101280a@phx.gbl... > In Visual Basics I have my code that says: > > Dim Notes As String > Notes = ... > > I want to be able to say something like: > > Dim Picture As ? > Picture = OLEPic > > What would I set the picture type as? > > Also how can I make change the font size and make it bold? > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
What I am trying to do is send my form in an email with
just the record that is being displayed. I have it so that the emailing part works, I am just having trouble setting up the design of the email. I am just sending the information to outlook from access. What I would like to do is make it so that I could somehow get a picture of the what the form looks like with the selected record. Is there any way to do this? if not how can I tell it to insert a picture. This is the code that I currently have: '******begin code****** Dim EmailAddress As String Dim Subject As String Dim EmailMessage As String 'Dim Picture As ???? '**create variables for Outlook Dim objOutlook As Outlook.Application Dim MyEmail As Outlook.MailItem '**gathers information from your form. this sets the string variable to your fields EmailAddress = Me.Email Subject = "..." EmailMessage = Picture & EmailMessage '***creates an instance of Outlook Set objOutlook = CreateObject("Outlook.application") Set MyEmail = objOutlook.CreateItem(olMailItem) '***creates and sends email With MyEmail .To = EmailAddress .Subject = Subject .Body = EmailMessage .Send 'sends the email in Outlook. End With '**closes outlook objOutlook.Quit Set MyEmail = Nothing Exit Sub '****end code**** |
|
|
|
#5 |
|
Guest
Posts: n/a
|
i think you have send your picture as attachment. Outlook.MailItem have a
methof to do this, you have to pass a full path to your picture -- Alex Dybenko (MVP) http://Alex.Dybenko.com "Dan" <anonymous@discussions.microsoft.com> wrote in message news:7eef01c3e821$1e6c1370$a601280a@phx.gbl... > What I am trying to do is send my form in an email with > just the record that is being displayed. I have it so > that the emailing part works, I am just having trouble > setting up the design of the email. I am just sending the > information to outlook from access. What I would like to > do is make it so that I could somehow get a picture of > the what the form looks like with the selected record. Is > there any way to do this? if not how can I tell it to > insert a picture. This is the code that I currently have: > > '******begin code****** > Dim EmailAddress As String > Dim Subject As String > Dim EmailMessage As String > > 'Dim Picture As ???? > > '**create variables for Outlook > Dim objOutlook As Outlook.Application > Dim MyEmail As Outlook.MailItem > > '**gathers information from your form. this sets the > string variable to your fields > > EmailAddress = Me.Email > Subject = "..." > EmailMessage = Picture & EmailMessage > > '***creates an instance of Outlook > Set objOutlook = CreateObject("Outlook.application") > Set MyEmail = objOutlook.CreateItem(olMailItem) > > '***creates and sends email > > With MyEmail > .To = EmailAddress > .Subject = Subject > .Body = EmailMessage > .Send 'sends the email in Outlook. > End With > > '**closes outlook > objOutlook.Quit > Set MyEmail = Nothing > > Exit Sub > '****end code**** |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

