Compose mail in gmail VBA

ExcelTheCell

Board Regular
Joined
Nov 14, 2010
Messages
158
Code:
IE.Navigate "[URL]https://mail.google.com/mail/u/0/#inbox[/URL]"
I'm allways sign in. All i need is code that will click on Compose button and insert text in fileds TO,BODY and send to recipient, and possible to sign out from account
Any easy way...
 
Last edited:
Code:
IE.Navigate "[URL]https://mail.google.com/mail/u/0/#inbox[/URL]"
I'm allways sign in. All i need is code that will click on Compose button and insert text in fileds TO,BODY and send to recipient, and possible to sign out from account
Any easy way...

As easy as:
Code:
IE.Navigate "https://mail.google.com/mail/u/0/#compose"
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Great you will come to the compose... Now, tell me how will you enter text in fields TO, Body and SEND TO and after that sing out... They use Iframes and it's really messy job to get actual code that will work without using CDO.mail.
 
Upvote 0
Code:
IE.Navigate "https://mail.google.com/mail/u/0/#compose&to=adreess@mail.com&subject=Test&bcc=address2@mail.com
 
Upvote 0
To sign out of gmail. (You probably learnt it yourself by now..)
Code:
IE.Navigate "https://mail.google.com/mail/u/0/?logout"
 
Upvote 0
Code:
IE.Navigate "https://mail.google.com/mail/u/0/#compose&to=adreess@mail.com&subject=Test&bcc=address2@mail.com


Well yeah iI have found out for the logout but code for compose will bring you back to inbox.. thanx for try but it doesnt work :(

Code:
Sub AfterLogin()
Dim IE As InternetExplorer
Set IE = New InternetExplorer
IE.Visible = True
IE.Navigate "https://mail.google.com/mail/u/0/#compose&to=adreess@mail.com"
End Sub
 
Upvote 0
I just tested it on my mobile AND on my pc. it really logs you out.
Compose does NOT bring me back.
 
Upvote 0
Yes, just started happening to me too, bringing me back to inbox instead of compose. I guess google is tricking on us.
Did you find any other workaround?
(last resort would be using sendkeys - gmail shortcuts.)
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top