Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / November 2006

Tip: Looking for answers? Try searching our database.

Use field in outlook custom form to populate excel sheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jade - 11 Nov 2006 19:54 GMT
Hello everyone,

I have an excel sheet ("Test") which in range ("D3") I would like to
add the field ("txtName") from a custom outlook calendar form
("Page2").  I realize I'm missing a step.  Can someone lend me some
assistance?

Thanks...

Sub cmdGetExcel_Click()
dim myIns,strName
strName="C:\Documents and Settings\Jackie\My Documents\OutlookTest.xls"
    set myIns=item.getinspector
    set myPage=myIns.modifiedformpages("Page2")
    set txtName=myPage.Controls("txtName")

set appExcel=createobject("Excel.Application")
appExcel.workbooks.open (strName)
appExcel.application.visible=true
    set wkb=appExcel.activeworkbook
    set wks=wkb.Worksheets("Sheet1")
    wks.activate
    set rng=wks.Range("D3")
    rng.value=item.userproperties("txtName")
Set appExcel = Nothing
End Sub
Sue Mosher [MVP-Outlook] - 29 Nov 2006 21:38 GMT
txtName sounds like the name of a control, not the name of a field. Since you're treating it as both below, it's impossible to know which is correct. The syntax for both is covered at http://www.outlookcode.com/d/propsyntax.htm 

Signature

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
 

> Hello everyone,
>
[quoted text clipped - 22 lines]
> Set appExcel = Nothing
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.