#1   Report Post  
Posted to microsoft.public.word.docmanagement
dmorri35 dmorri35 is offline
external usenet poster
 
Posts: 1
Default Insert Comments

I would like to use the "insert comments" function in conjunction with a
pre-made list of comments (which I have stored in excel).

I would like to do something like this: identify each pre-made comment with
a number, and then simply push a button in reference to that number to insert
the text associated with that number. this way, I don't have to keep writing
similar comments into the document from scratch each time they come up.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Insert Comments

This is untested so may need a bit of tweaking, but if you have the assign
the name ArCommentsRange to the Range in the spreadsheet that contains the
comments and modify the path in the following code as appropriate and you
insert 1 as a comment in the document where ever you want the first comment
from your Excel Spreadsheet to appear in the document, 2 where ever you want
the second to appear and so on and then if you run a macro containing the
following code, it should replace those numerals with the respective
comments from the Excel source:

'Uses early binding see:
http://www.word.mvps.org/FAQs/InterD...ateBinding.htm
'You need to set a reference in your project to the €śMicrosoft Excel Object
Library€ť.
Dim xlApp As Excel.Application
Dim xlbook As Excel.Workbook
Dim ArComments As Variant
Dim bStartApp As Boolean
Dim acomment As Comment
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err Then
bStartApp = True
Set xlApp = New Excel.Application
End If
On Error GoTo 0
With xlApp
Set xlbook = .Workbooks.Open("F:\Data Stores\sourceSpreadsheet.xls")
'modify path
ArComments = xlbook.Names("ArCommentsRange").RefersToRange.Valu e
xlbook.Close SaveChanges:=False
Set xlbook = Nothing
End With
If bStartApp Then xlApp.Quit
Set xlApp = Nothing

For Each acomment In ActiveDocument.Comments
If Isnumeric(acomment.Range.Text) then
acomment.Range.Text = ArComments(acomment.Range.Text - 1)
End if
Next acomment


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"dmorri35" wrote in message
...
I would like to use the "insert comments" function in conjunction with a
pre-made list of comments (which I have stored in excel).

I would like to do something like this: identify each pre-made comment
with
a number, and then simply push a button in reference to that number to
insert
the text associated with that number. this way, I don't have to keep
writing
similar comments into the document from scratch each time they come up.

Any suggestions?


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you insert comments into footnotes? JimJones Microsoft Word Help 5 July 13th 22 05:50 AM
How do I insert comments without a comment option under insert? Lucy Microsoft Word Help 2 August 23rd 07 07:55 PM
Insert comments and track changes in Word 12? Danish Munir Microsoft Word Help 1 November 25th 05 12:57 AM
Insert Comments HT New Users 2 August 25th 05 07:07 PM
insert comments Campbell Stanford Microsoft Word Help 4 May 22nd 05 06:39 PM


All times are GMT +1. The time now is 11:31 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"