Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Note Code Help

I have the following code:

On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment &
Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author")
& _
": Rev. " & Format(Date, "mm-dd-yyyy") & ", From
(" & Worksheets("Password").Range("A16").Value & ")"



I have two problems: 1) I want it to put in the note the
person who is logged in, not the ("Author").

2) I want this note to be visibale.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Note Code Help

From: Trevor Shuttleworth )
Subject: Code to show login name
Newsgroups: microsoft.public.excel.programming
Date: 2001-01-16 12:54:01 PST



Private Declare Function apiGetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nsize As Long) As Long

Sub GetUserNameTest()
MsgBox fOSUserName
End Sub

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX < 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If
End Function

-------------------

Mr. Erlandsend's site:
http://www.erlandsendata.no/english/vba/os/index.htm

has code for username and computer name.

Regards,
Tom Ogilvy

scrabtree23 wrote in message
...
I have the following code:

On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment < "" Then curComment = curComment &
Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author")
& _
": Rev. " & Format(Date, "mm-dd-yyyy") & ", From
(" & Worksheets("Password").Range("A16").Value & ")"



I have two problems: 1) I want it to put in the note the
person who is logged in, not the ("Author").

2) I want this note to be visibale.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Like a note but it's not-What is it? Gary S[_2_] Excel Discussion (Misc queries) 4 July 31st 09 02:13 PM
Validation note to comment note Oldjay Excel Discussion (Misc queries) 1 August 23rd 07 04:27 PM
a note on a workbook egtippie Excel Worksheet Functions 2 June 19th 06 09:23 PM
I want to insert a note Sam Excel Discussion (Misc queries) 3 November 23rd 05 11:02 AM
A Thank You note to Pio Sjoblom RWN Excel Programming 0 November 9th 03 10:34 PM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"