?
Solved

Outlook and Visual Basic

Posted on 2003-11-12
6
Medium Priority
?
945 Views
Last Modified: 2013-12-04
I have build a custom form in outlook 2000 which has 2 labels. Now i am calling this function from a visual basic project which is sending this form as mail.This is what i am writing in the vb project. This vb project i am creating in Visual Basic 6.0.
general Declaration
Dim objoutlookapp As New Outlook.Application
Dim objoutlookmail As Outlook.MailItem
Dim objins As Outlook.Inspector
Dim objModifiedForm

on button click:
Set objoutlookapp = New Outlook.Application
Set objoutlookmail = objoutlookapp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items.Add("IPM.Note.HEP_RESPONSE")
Set objModifiedForm = objoutlookmail.GetInspector.ModifiedFormPages("Response")
objModifiedForm.Controls("lblRsNoVal").Caption = "23445"
objModifiedForm.Controls("lblCustNo").Caption = "1234"
objoutlookmail.To = "fdfdf"

objoutlookmail.Display
and then the user clicks send.
Now the problem is that before sending the mail all the label values is coming but on receiver end these values are not coming.  I have already attached these values by creating the "user fields" in the custom form but still it is not getting saved.

any idea where i am wrong!!!
0
Comment
Question by:pg_india
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9738964
is the reciever getting the custom form or a normal form?
0
 
LVL 3

Author Comment

by:pg_india
ID: 9739040
the custom form, but the value in the fields is not coming.
Has some one tried it out before!!!!!!!!!!
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9745181
I have not done it thro a macro but will revert back
0
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
LVL 3

Author Comment

by:pg_india
ID: 9745520
i am not using the macro. i have created a vb program which is opening the outlook object and doing the above steps.

Kindly tell me how to do this!!!
I don't have much points so increasing the points by 20.
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9745599
pg dont worry on points. this is not the only reason i answer questions

is the custom form showing the fields? when i created a custom form
objoutlookmail.GetInspector.ModifiedFormPages("Response") returned nothing. can you explaing the custom form setting? one more thing can you email me the custom form ro bhagyesht "at" fastmail.fm?
from the code the following can be concluded
you are setting the caption's value
just in case you are not aware in a custom form you have 2 pages one for the editing or composing and the other is for the user to read. you should be able to see both this pages from the form menu and select edit read page. its the read page that the user sees. try to set values to this page.
or tell me what are your custom form's settings
0
 
LVL 9

Accepted Solution

by:
bhagyesht earned 280 total points
ID: 9745884
ok pg I was able to send a message with user defined fields and the following is how you should be able to do the same.
first i designed a form and published it under the name as HEP_RESPONSE
then in the "All fields" tab under the drop down of "select from" select HEP_RESPONSE
add a property named as bt1
publish the form
now make active the message tab
goto the form menu and select "Edit Read page"
add a label
right click on the label and goto properties
goto the value tab and select the field bt1
publish the form

now the following code runs fine



'code begins
Dim objoutlookapp As New Outlook.Application
Dim objoutlookmail As Outlook.MailItem
Dim objins As Outlook.Inspector
Dim objModifiedForm

Set objoutlookapp = New Outlook.Application
Set objoutlookmail = objoutlookapp.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Items.Add("IPM.Note.HEP_RESPONSE")

objoutlookmail.UserProperties("bt1").Value = "1234"
objoutlookmail.To = "test@testme.com"

objoutlookmail.Display
'code ends
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question