Results 1 to 9 of 9

Thread: Huge VBA newb needs help with plugin automation.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Huge VBA newb needs help with plugin automation.

    Hey guys,
    I need to implement PGP in my business to secure emails that must the sent securely on a monthly basis. Due to the fact that humans are human and bound both by habit and to forget, I need to automate the encryption of that monthly e-mail.
    I'd like to have the process be near fully automatic, such as engaged when the user types a certain message into his or her subject line of the e-mail, or when there's a couple of conditions that are met in the message. I've yet to decide what the condition will be, but I think something in the subject will do.
    I'm using GPG (the freeware open-source version of PGP), which creates a plug-in button in Outlook. For the sake of testing, I've made a shortcut to that button on the ribbon on my computer only. I anticipate this being something that only some users do and other's dont, so I can't depend on the presence of the ribbon. The presence of the Add-In should be enough.

    Basically, then, what I need to do is monitor all outgoing subjects. If the subject contains "Monthly Report", for instance, that Add-In button will be clicked. If it doesn't it won't. Can anyone give me a starting point? I don't expect you to do the work for me, as I know I won't learn anything, but I don't even know where to start.

    I know that my users are using varied versions of Office, ranging from Office 2000 to Office 2007, so the script (or idea) will need to be cross-version compatible.

    If it helps, I'm an adept VB6 developer, and have 10+ years coding. I just don't know about the VBA object library or coding convention for VBA objects. For all I know there is a simpler way to do this than with a macro.

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Huge VBA newb needs help with plugin automation.

    Hi Dragon, I haven't worked with PGP or GPG... but what I could understand that you want an addin which monitors the outgoing email and if a particular condition is met then do some action... Is that correct... also this addin should be compatible with all versions of outlook?

    If that is correct the In the VBA environment, select Application from the left combobox above the code window, then select ItemSend from the right combobox. That will create the declaration of the procedure for you. You can read the Subject as shown below and set the Cancel argument to True if you want to cancel the sending process.

    See the below code and screenshot...

    vb Code:
    1. '~~> This event checks and outgoing mail
    2. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    3.     Dim CheckString As String
    4.    
    5.     '~~> Say you want to check this word in the subject
    6.     CheckString = "Facebook"
    7.    
    8.     If InStr(Item.Subject, CheckString) Then
    9.         MsgBox "The Company Policy doesn't allow you to send this mail"
    10.         '~~> The mail won't go even if the user presses send....
    11.         Cancel = True
    12.     End If
    13. End Sub
    Attached Images Attached Images  
    Last edited by Siddharth Rout; Apr 3rd, 2009 at 02:27 PM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Huge VBA newb needs help with plugin automation.

    Right. That is what I want to do.
    The actual action that I need to perform, though, is changing the status of another add in. That's the part I'm a bit confused about.

  4. #4
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Huge VBA newb needs help with plugin automation.

    The actual action that I need to perform, though, is changing the status of another add in. That's the part I'm a bit confused about.
    Can you explain it a bit more?
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Huge VBA newb needs help with plugin automation.

    Well....I use GPG, the free version of PGP (as mentioned in post 1). A new MA law requires that all "personal information" being transmitted over e-mail be secured. As a temporary solution, while I rebuild the company's IT department, I'll get up a keyserver and use PGP (or GPG, as the case may be). GPG has an Outlook plug-in.
    The GPG plug in is simply a toggle button to enable and disable encrypting the message using GPG via the plug-ins tab of a new e-mail message in Outlook 2007. (It's located in other places in other versions of Outlook, but so far Outlook 2007 is the only version with which I've tested.)

    I don't trust human nature enough to ensure that the first and every time the "information" is transmitted that the sender will break habit and activate the plug-in, and I don't trust some people to respect the urgency with which this matter must be implemented. I want to write some code so they just have to enter a word, say "Activate" (it won't be that obvious - more than likely a simple subject that they're already using now, but that I can't reveal for the sake of company security), in the subject line and my macro will take care of enabling or disabling the plug-in.
    Last edited by drag0n_45; Apr 5th, 2009 at 02:43 AM.

  6. #6
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Huge VBA newb needs help with plugin automation.

    So basically instead of showing a message you want to activate another macro/plugin which will encrypt the message? Sorry if I have misunderstood you...
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Huge VBA newb needs help with plugin automation.

    That's exactly correct.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2007
    Location
    Middletown, CT
    Posts
    948

    Re: Huge VBA newb needs help with plugin automation.

    Does anyone know how to do this?

  9. #9
    New Member
    Join Date
    Jul 2009
    Posts
    7

    Re: Huge VBA newb needs help with plugin automation.

    but how can i write same code in VSTO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width