+ Reply to Thread
Results 1 to 2 of 2

Thread: VBA with Outlook's Web App

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Raleigh, Nc
    MS-Off Ver
    Excel 2007
    Posts
    11

    VBA with Outlook's Web App

    does anyone have any experience with outlook's web app? i am trying to create a routine that when a button is clicked, it will open up outlook web app (through internet explorer), log in and attach a file to a new email. i have gotten so far as to log in and create a new email, but can not seem to get anywhere. any help would be greatly appreciated. code attached (the text "WHOA DUDE" will appear in the subject line)

    Sub openinternetexplorer()
    Dim IEApp As InternetExplorer
    Dim URL As String
    Dim I As Integer
    
    Set IEApp = New InternetExplorer        'creates new internet explorer application
    
    IEApp.Visible = True 'makes IE visible
    IEApp.navigate ("webmail.technimark.com")
    Application.Wait (Now + TimeValue("0:00:10"))
    
    Do
    Loop Until IEApp.readyState = READYSTATE_COMPLETE
    
    Set ipf = IEApp.document.all.Item("username")
        
            ipf.Value = InputBox("enter username")
            Set ipf = IEApp.document.all.Item("password")
            ipf.Value = InputBox("enter password")
        
            Set ipf = IEApp.document.getElementsByTagName("input")
                I = 0
                    Do While I < ipf.Length
                        If ipf(I).Type = "submit" Then
                            Set ipo = ipf(I)
                            Exit Do
                        End If
                    I = I + 1
                    Loop
         
            ipo.Click
        
    IEApp.Visible = False
    
    Do
    Loop Until IEApp.readyState = READYSTATE_COMPLETE
    Set newpage = New InternetExplorer
        newpage.Visible = True
        newpage.navigate ("https://webmail.technimark.com/owa/?ae=Item&a=New&t=IPM.Note&cc=MTQuMS4yMTguMTMsZW4tVVMsNDI5NDk2NzI5NSxIVE1MLDAsMA==&pspid=_1307133381266_663185185")
        
    
    Do
    Loop Until newpage.readyState = READYSTATE_COMPLETE
    
    Set ipf = newpage.document.getElementsByTagName("input")
        I = 0
        Do While I < ipf.Length
            If ipf(I).Type = "text" Then
                Set ipo = ipf(I)                            'SUBJECT LINE
                Exit Do
            End If
         I = I + 1
         Loop
    ipo.Value = "Whoa Dude"
    
    
    
    
    
    
    
    
        
    Set IEApp = Nothing
    Set ipo = Nothing
    Set ipf = Nothing
    Set newpage = Nothing
    
    
    
    
    End Sub

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,645

    Re: VBA with Outlook's Web App

    Not sure what you are doing exactly, but I don't think web apps support VBA
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0