PC Review


Reply
Thread Tools Rate Thread

Excel and Outlook Calendars

 
 
=?Utf-8?B?SiBTdHJlZ2Vy?=
Guest
Posts: n/a
 
      17th Nov 2005
I am writing a procedure in VBA, in Excel that will pull the appointment
information from Outlook to Excel. What I also want to do is pull the account
name from Outlook, so I know who is working on the excel sheet, since not
everyone has set their properties the same. I can't find the command string
to get this string property. Does anyone know how or if this information can
be gleaned from an Excel macro? Thanks.

--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RXJpYyBMZWdhdWx0IFtNVlAgLSBPdXRsb29rXQ==
Guest
Posts: n/a
 
      17th Nov 2005
If you want the full name of the user, use the NameSpace.CurrentUser
property. If you want the name of their Windows login account, use this code:

Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long

Public Function FindUserName() As String

Dim strBuffer As String
Dim lngSize As Long

strBuffer = String(100, " ")
lngSize = Len(strBuffer)

If GetUserName(strBuffer, lngSize) = 1 Then
FindUserName = Left(strBuffer, lngSize)
Else
Exit Function
End If

'ELIMINATES NULL CHARACTERS
FindUserName = Replace(FindUserName, Chr(0), "")
End Function

--
Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"J Streger" wrote:

> I am writing a procedure in VBA, in Excel that will pull the appointment
> information from Outlook to Excel. What I also want to do is pull the account
> name from Outlook, so I know who is working on the excel sheet, since not
> everyone has set their properties the same. I can't find the command string
> to get this string property. Does anyone know how or if this information can
> be gleaned from an Excel macro? Thanks.
>
> --
> *********************
> J Streger
> MS Office Master 2000 ed.
> MS Project White Belt 2003
>

 
Reply With Quote
 
Zack Barresse
Guest
Posts: n/a
 
      1st Dec 2005
Windows User name, see the already given API call. Just username?

Environ("Username")

I would use this before I called a property from the Outlook Object Model
from within Excel. Personal preference.

HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)
To email, remove the NO SPAM. Please keep correspondence to the board, as
to benefit others.


"J Streger" <(E-Mail Removed)> wrote in message
news:1A253A1C-0CCA-46C1-810C-(E-Mail Removed)...
>I am writing a procedure in VBA, in Excel that will pull the appointment
> information from Outlook to Excel. What I also want to do is pull the
> account
> name from Outlook, so I know who is working on the excel sheet, since not
> everyone has set their properties the same. I can't find the command
> string
> to get this string property. Does anyone know how or if this information
> can
> be gleaned from an Excel macro? Thanks.
>
> --
> *********************
> J Streger
> MS Office Master 2000 ed.
> MS Project White Belt 2003
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove calendars from My Calendars in Outlook 2007? =?Utf-8?B?TWljcm9OYXY=?= Microsoft Outlook Calendar 3 13th Feb 2007 04:50 PM
Copying Excel schedules to different Outlook Calendars littlegreenmen1 Microsoft Excel Misc 0 1st Jul 2005 10:04 PM
Outlook2003 - other users Calendars listed in "My Calendars" and "Other Calendars" names disappearing but check box remains? Paul Rouse Microsoft Outlook Calendar 1 21st Apr 2005 05:07 PM
Is there any way to hide multiple calendars in My Calendars in Outlook 2003 Rob Ingram Microsoft Outlook Calendar 1 19th Nov 2003 08:50 PM
subject ---> creating an excel report based off Outlook public calendars... Normand Microsoft Outlook Form Programming 1 15th Jul 2003 12:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:58 PM.