Click here to Skip to main content
15,887,434 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Counting Records added and modified in a DataSet Pin
Dave Kreskowiak23-May-07 6:55
mveDave Kreskowiak23-May-07 6:55 
Questionpull data from access database table to vb.net Pin
jds120723-May-07 3:56
jds120723-May-07 3:56 
AnswerRe: pull data from access database table to vb.net Pin
Dave Kreskowiak23-May-07 6:43
mveDave Kreskowiak23-May-07 6:43 
QuestionUsing the character '&' in Label.Text Pin
RichFeldman23-May-07 3:44
RichFeldman23-May-07 3:44 
AnswerRe: Using the character '&' in Label.Text Pin
Kschuler23-May-07 4:10
Kschuler23-May-07 4:10 
Questionhow do u communicate btn a webserver and a remote computer via the internet? Pin
dleo1023-May-07 3:22
dleo1023-May-07 3:22 
AnswerRe: how do u communicate btn a webserver and a remote computer via the internet? Pin
Dave Herren23-May-07 3:36
Dave Herren23-May-07 3:36 
QuestionMS Outlook macro help... Pin
Fred_Smith23-May-07 2:18
Fred_Smith23-May-07 2:18 
This isn't VB so much as VBA, I guess, but maybe someone can help...

MS Outlook allows you to open a message and remove any attachments (right-click and select "Remove") - the trouble is that having done so there is no record left of it... I wanted a way to insert a line ssayting "attachment xyz.doc removed", or something.

I came up with a little macro to do this, below, but it has a side-effect of also removing all and any formatting in the email body as well, which is somehwta unfortunate.

If anyone can help with how to re-write this to
a) ermove the attachment(s)
b) insert/append line(s) saying what has been removed
c) retain the original formatting (html) of the message

I would be most grateful...

cheers
Fred


Sub delAttach()
Dim i%, k%, km%, v$

On Error Resume Next

With ActiveExplorer.Selection
For i = 1 To .Count
' Debug.Print i, .Item(i).Subject, .Item(i).Attachments.Count

Err.Clear
km = .Item(i).Attachments.Count
If km > 0 Then
v = Format$(km)
k = 1
.Item(i).Body = .Item(i).Body & vbCrLf & vbCrLf & "--- " & km & " Attachment(s) removed " & _
Now & " -------------------------" & vbCrLf

Do While k <= km
.Item(i).Body = .Item(i).Body & vbCrLf & .Item(i).Attachments(k).FileName
k = k + 1
Loop

Do While k > 1
k = k - 1
.Item(i).Attachments(k).Delete
Loop

.Item(i).Body = .Item(i).Body & vbCrLf & "---------------------------------"

.Item(i).UserProperties.Add "AttachRmvd", olText
.Item(i).UserProperties("AttachRmvd") = v
If Err = 0 Then .Item(i).Save

End If

Next i
End With

End Sub
AnswerRe: MS Outlook macro help... Pin
Dave Kreskowiak23-May-07 6:01
mveDave Kreskowiak23-May-07 6:01 
GeneralRe: MS Outlook macro help... Pin
Fred_Smith23-May-07 6:19
Fred_Smith23-May-07 6:19 
GeneralRe: MS Outlook macro help... Pin
Dave Kreskowiak23-May-07 6:33
mveDave Kreskowiak23-May-07 6:33 
GeneralRe: MS Outlook macro help... Pin
Fred_Smith23-May-07 6:43
Fred_Smith23-May-07 6:43 
Questionfour events and one handler Pin
Sonia Gupta23-May-07 1:28
Sonia Gupta23-May-07 1:28 
AnswerRe: four events and one handler Pin
CPallini23-May-07 1:38
mveCPallini23-May-07 1:38 
GeneralRe: four events and one handler Pin
Sonia Gupta23-May-07 1:52
Sonia Gupta23-May-07 1:52 
AnswerRe: four events and one handler Pin
Rupesh Kumar Swami23-May-07 1:40
Rupesh Kumar Swami23-May-07 1:40 
GeneralRe: four events and one handler Pin
Sonia Gupta23-May-07 1:52
Sonia Gupta23-May-07 1:52 
Questionuninstallation icon Pin
Sonia Gupta23-May-07 1:22
Sonia Gupta23-May-07 1:22 
AnswerRe: uninstallation icon Pin
kubben23-May-07 2:24
kubben23-May-07 2:24 
QuestionRe: uninstallation icon Pin
Sonia Gupta23-May-07 2:43
Sonia Gupta23-May-07 2:43 
AnswerRe: uninstallation icon Pin
kubben23-May-07 2:49
kubben23-May-07 2:49 
AnswerRe: uninstallation icon Pin
kubben23-May-07 2:55
kubben23-May-07 2:55 
GeneralRe: uninstallation icon [modified] Pin
Sonia Gupta23-May-07 3:02
Sonia Gupta23-May-07 3:02 
QuestionInstall True Type Font Pin
Rupesh Kumar Swami23-May-07 0:52
Rupesh Kumar Swami23-May-07 0:52 
AnswerRe: Install True Type Font Pin
Steven J Jowett23-May-07 1:18
Steven J Jowett23-May-07 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.