strMyInput and competing emailadress...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I got my inputbox to work and am able to replace the **** with the word from
the inputbox.
Can I do this also for his emailaddress? we are all on the same domain so
everything that comes behind the @ is the same for everybody in our squads.

I tried using my recipient and createrecipient but I still don't know the
code properly.

And what is the proper code to add a recipient to a custom form?

Here is the code I'm using so far...
Sub test()
strMyInput = InputBox("recruitname?")
strMyInput2 = InputBox("Password?")
Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to GR")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to CoC")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to Recruit")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "§§§§§§", strMyInput2)
objItem.Body = strBody
objItem.Display
End Sub

Last thing, why is my nice html formatting gone when I open those forms with
the macro...?
 
Exactly what are you trying to change and where? I can't tell from your
post.

Terminology check:

Item = single data record, e.g. message, contact, task, etc.
Form = layout/code template, used to display items

To add a recipient to an item (NOTE: not form; see above) from code within
that item's form, use the Item.Recipients.Add method.

Your nice HTML formatting is gone because you're performing the Replace() in
Body, not HTMLBody. (Look back at my first response to your earlier thread.)

Also note that it's best to call Display only after you've made all the
desired changes to the item.
 
what needs to happen is this:
1)I need to open those 3 mails <- working
2) i need to replace ****** with a name <- working
3) i need to replace ####### with a password <- working
4) i need to send one of the 3 emails to [the name i filled in in the
inputbox that's used to replace the ******]
5) some if then commands that I still need to program.

Problem with the html is meanwhile solved.
Thx Sue
 
As I said, you use Item.Recipients.Add to add another address to the item.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Bart Cuenen said:
what needs to happen is this:
1)I need to open those 3 mails <- working
2) i need to replace ****** with a name <- working
3) i need to replace ####### with a password <- working
4) i need to send one of the 3 emails to [the name i filled in in the
inputbox that's used to replace the ******]
5) some if then commands that I still need to program.

Problem with the html is meanwhile solved.
Thx Sue
Sue Mosher said:
Exactly what are you trying to change and where? I can't tell from your
post.

Terminology check:

Item = single data record, e.g. message, contact, task, etc.
Form = layout/code template, used to display items

To add a recipient to an item (NOTE: not form; see above) from code
within
that item's form, use the Item.Recipients.Add method.

Your nice HTML formatting is gone because you're performing the Replace()
in
Body, not HTMLBody. (Look back at my first response to your earlier
thread.)

Also note that it's best to call Display only after you've made all the
desired changes to the item.
 
heh, found it!

thx again Sue!

Sue Mosher said:
As I said, you use Item.Recipients.Add to add another address to the item.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Bart Cuenen said:
what needs to happen is this:
1)I need to open those 3 mails <- working
2) i need to replace ****** with a name <- working
3) i need to replace ####### with a password <- working
4) i need to send one of the 3 emails to [the name i filled in in the
inputbox that's used to replace the ******]
5) some if then commands that I still need to program.

Problem with the html is meanwhile solved.
Thx Sue
Sue Mosher said:
Exactly what are you trying to change and where? I can't tell from your
post.

Terminology check:

Item = single data record, e.g. message, contact, task, etc.
Form = layout/code template, used to display items

To add a recipient to an item (NOTE: not form; see above) from code
within
that item's form, use the Item.Recipients.Add method.

Your nice HTML formatting is gone because you're performing the Replace()
in
Body, not HTMLBody. (Look back at my first response to your earlier
thread.)

Also note that it's best to call Display only after you've made all the
desired changes to the item.

I got my inputbox to work and am able to replace the **** with the word
from
the inputbox.
Can I do this also for his emailaddress? we are all on the same domain
so
everything that comes behind the @ is the same for everybody in our
squads.

I tried using my recipient and createrecipient but I still don't know
the
code properly.

And what is the proper code to add a recipient to a custom form?

Here is the code I'm using so far...
Sub test()
strMyInput = InputBox("recruitname?")
strMyInput2 = InputBox("Password?")
Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to GR")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to CoC")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add("IPM.Note.Bootcamp done to Recruit")
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "******", strMyInput)
objItem.Body = strBody
objItem.Display

strBody = objItem.Body
strBody = Replace(strBody, "§§§§§§", strMyInput2)
objItem.Body = strBody
objItem.Display
End Sub

Last thing, why is my nice html formatting gone when I open those forms
with
the macro...?
 
Back
Top