|
-
Feb 1st, 2013, 10:44 AM
#1
Thread Starter
New Member
Test
Hello
I am very new to this, first forum, first code.. ugh.
Below is a code I am having a problem with. I created a form in Outlook 2010 and want to send the body of the text and drop boxes to Excel.
Sub SendExcel()
Dim OFT, Nrow As String
Dim Name, SentDate, Shift, MainProblem, ProblemsReported, Equipmentinstalled, FollowUP, WorkingOn As String
Dim SuggestOFt As Integer
Dim outMail As Object
Dim xlapp As Object
Set outMail = ActiveInspector.Current
strgfldr = "c:\Users\206013841\appData\Roaming\Microsoft\Templates\DailyForms.xls"""
Set xlapp = CreateObject("Excel.Application")
xlapp.Application.Visible = True
xlapp.Workbooks.Open "C:\Users\206013841\appData\Roaming\Microsoft\Templates\DailyForms.xls"
Nrow = Application.ActiveWindow.Application
Nrow = xlApp.WorksheetFunction(CountA.xlbook.sheets("EmailData).Range("A:H"))
xlapp.sheets("EmailData").Range("A" & Nrow + 1).Value = OFT
xlapp.sheets("EmailData").Range("B" & Nrow + 1).Value = outMail.SenderEmailAddress
xlapp.sheets("EmailData").Range("C" & Nrow + 1).Value = outBody.Shift
xlapp.sheets("EmailData").Range("D" & Nrow + 1).Value = outBody.MainProblem
xlapp.sheets("EmailData").Range("E" & Nrow + 1).Value = outBody.ProblemReported
xlapp.sheets("EmailData").Range("F" & Nrow + 1).Value = outBody.Equipmentinstalled
xlapp.sheets("EmailData").Range("G" & Nrow + 1).Value = outBody.FollowUP
xlapp.sheets("EmailData").Range("H" & Nrow + 1).Value = outBody.WorkingOn
xlapp.sheets("EmailData").Range("H1").Activate
xlapp.sheets("EmailData").Columns("A:H").EntireColumn.AutoFit
xlapp.sheets("EmailData").SaveAs strFldr & "\" & "EmailTest.xls"
End Sub
Any suggestions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|