Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default add an inventory item to a word doc if there is a Y in column C

Hi,

This code from ron de bruin sends an e-mail to each address in column B if
there is a Y in column C.

For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And cell.Offset(0, 1).Value = "y" Then
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = cell.Value
.Subject = Cells(1, 4)
.Body = "Dear " & cell.Offset(0, -1).Value & "," &
vbNewLine & vbNewLine & strbody
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
'.Send 'Or use Display
End With
Set OutMail = Nothing
End If
End If
Next cell

If column B contained an inventory list, could the above code be amended to
add an inventory item to a word doc if there is a Y in column C?

Thanks in advance for any assistance.
DL


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default add an inventory item to a word doc if there is a Y in column C


why do you post a procedure that is intended for email,
while you want to work with Word NOT Outlook?

search google on "excel export word"
and you should find a more appropriate example.

try for instance he
http://www.erlandsendata.no/english/...olecontrolword



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"fitful_thought" wrote:

Hi,

This code from ron de bruin sends an e-mail to each address in column
B if there is a Y in column C.

For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And cell.Offset(0, 1).Value = "y"
Then
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = cell.Value
.Subject = Cells(1, 4)
.Body = "Dear " & cell.Offset(0, -1).Value & "," &
vbNewLine & vbNewLine & strbody
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
'.Send 'Or use Display
End With
Set OutMail = Nothing
End If
End If
Next cell

If column B contained an inventory list, could the above code be
amended to add an inventory item to a word doc if there is a Y in
column C?

Thanks in advance for any assistance.
DL




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default add an inventory item to a word doc if there is a Y in column C

That's useful.

Thanks.

DL


"keepITcool" wrote in message
...

why do you post a procedure that is intended for email,
while you want to work with Word NOT Outlook?

search google on "excel export word"
and you should find a more appropriate example.

try for instance he
http://www.erlandsendata.no/english/...olecontrolword



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"fitful_thought" wrote:

Hi,

This code from ron de bruin sends an e-mail to each address in column
B if there is a Y in column C.

For Each cell In
Sheets("Sheet1").Columns("B").Cells.SpecialCells(x lCellTypeConstants)
If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*@*" And cell.Offset(0, 1).Value = "y"
Then
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = cell.Value
.Subject = Cells(1, 4)
.Body = "Dear " & cell.Offset(0, -1).Value & "," &
vbNewLine & vbNewLine & strbody
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display
'.Send 'Or use Display
End With
Set OutMail = Nothing
End If
End If
Next cell

If column B contained an inventory list, could the above code be
amended to add an inventory item to a word doc if there is a Y in
column C?

Thanks in advance for any assistance.
DL






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use word to associate an item in validation drop down list Otani Excel Discussion (Misc queries) 2 January 28th 10 02:40 PM
INVENTORY CONTROL BY SPECIFIC ITEM gam33040 Excel Discussion (Misc queries) 2 December 4th 08 03:55 PM
I want to project when inventory will zero out on an item. Mike Excel Discussion (Misc queries) 3 October 28th 08 02:50 PM
How do I build a excel sheet that counts item in an inventory kenny Excel Worksheet Functions 2 May 9th 06 04:03 PM
How list inventory item codes so that they will be sorted correctl I need to sort the items by their item Excel Discussion (Misc queries) 0 August 24th 05 06:36 PM


All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"