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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do I add a picture in a custom Contact form?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 30th 06, 03:14 AM posted to microsoft.public.outlook.program_forms
Wladdy
external usenet poster
 
Posts: 2
Default How do I add a picture in a custom Contact form?

I am making a custom contact form.
How do I attach a different picture for each contact, like in the
default Contact form?
Under what field will the the picture be embedded or linked to?

Thanks for helping me out.

W.

Ads
  #2  
Old June 30th 06, 04:17 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default How do I add a picture in a custom Contact form?

See my response to your post in another group.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Wladdy" wrote in message oups.com...
I am making a custom contact form.
How do I attach a different picture for each contact, like in the
default Contact form?
Under what field will the the picture be embedded or linked to?

Thanks for helping me out.

W.

  #3  
Old July 3rd 06, 10:37 AM posted to microsoft.public.outlook.program_forms
philippe
external usenet poster
 
Posts: 14
Default How do I add a picture in a custom Contact form?

Hi,

I've been through this two months ago.
There are several ways to go around the fact that you can not use the native
MS Control on the Contact form, but if you want to be clean and avoid one
offed forms there's only one way : you need to load a picture file into a
picture control. And it needs be a file. Moreover, the user's form must have
read AND write rights on the share where the pictures are stored, AND on the
pictures themselves.
This last point was the particular problem I discovered in the process : I
had to let users the capability to alter the pictures...

This problem I solved simply by emulating what is said to be the way the MS
Control actually work : I attach the picture to each contact item : same
method as to attach a file to mail item.
Then each time the form is opened, the attached picture will be saved to the
user's drive and loaded into a picture control with a vbs script on the form
(the vbs sript is from Sue).
This way the users have no rights to modify the pics : be it on a share, or
in the public folder, and the load method is happy with having all the rights
on the picture's copy.

Methods used - Most of it borrowed from Sue's book

** Saving attachment in VBS
FileName = "C:\Documents and Settings\" & strUser & "\" &
Item.Attachments(1).FileName
Item.Attachments(1).SaveAsFile FileName

** Be sure the saved picture is not read only
If FileName "" then
Const READ_ONLY = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(FileName)
If objFile.Attributes AND READ_ONLY Then objFile.Attributes =
objFile.Attributes XOR READ_ONLY
End If

** Loading the picture
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("Général")
Set imgPicture = objPage.Controls("Image4")
imgPicture.Picture = LoadPicture(FileName)

** Closing the item inspector properly
Function Item_Close()
' Interception de l'évènement de fermeture
Item_Close = False

If Item.Attachments.count 0 then
strUser = WSHUserName()
FileName = "C:\Documents and Settings\" & strUser & "\" &
Item.Attachments(1).FileName
End If
If FileName "" Then
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile FileName
End If
Item.Close 1
End Function

Regards,
Philippe


"Wladdy" a écrit :

I am making a custom contact form.
How do I attach a different picture for each contact, like in the
default Contact form?
Under what field will the the picture be embedded or linked to?

Thanks for helping me out.

W.


 




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
Is it possible to open the default Contact form with the Activities tab activated from a custom form? VSTO 2005, Outlook 2003 David Webb Outlook and VBA 1 June 20th 06 10:59 PM
Emailing a contact vCard with custom form loses all custom info Kim Outlook - Using Contacts 7 April 27th 06 01:21 AM
How to add sender name to cc for Custom Message form in Outlook David Tallahassee Outlook - Using Forms 2 March 29th 06 09:27 PM
Inserting a picture in the message body of a custom form groom Outlook - General Queries 1 February 8th 06 11:08 PM
How to handling Custom Form Control Event in VB Com Add-In? Raphaël ZHOU \(Jadiam\) Outlook - Using Forms 1 January 11th 06 08:31 AM


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