2016-06-24 84 views

回答

0

我不知道是否有一種方式來獲得從代碼GMAIL地址,除非他們有一個瀏覽器窗口中打開自己的Gmail帳戶

微軟的示例代碼來獲得當前用戶名

' Makes sure all variables are dimensioned in each subroutine. 
Option Explicit 

' Access the GetUserNameA function in advapi32.dll and 
' call the function GetUserName. 
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ 
(ByVal lpBuffer As String, nSize As Long) As Long 

' Main routine to Dimension variables, retrieve user name 
' and display answer. 
Sub Get_User_Name() 

' Dimension variables 
Dim lpBuff As String * 25 
Dim ret As Long, UserName As String 

' Get the user name minus any trailing spaces found in the name. 
ret = GetUserName(lpBuff, 25) 
UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1) 

' Display the User Name 
MsgBox UserName 
End Sub 
+0

不是用於Outlook的代碼 - 不是GMAIL? –

+0

它與任何電子郵件客戶端無關 - 它檢索當前計算機用戶名 – dbmitch

+0

但是,我正在查找當前用戶的Gmail電子郵件地址。 –

相關問題