Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

re: using a macro to input data at specific spot on document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HeatherO - 23 Feb 2005 01:57 GMT
How do I get the selection coordinates to put data that is stored in an excel
spreadsheet.  I can't use the mail merge since I need to read through the
file and only update for one instance of an account list the certain columns
and also Use 2 different documents based on the lang column in the excel
spreadsheet.  So I thought the simplest way is to use a vb procedure that
gets the coordinates of where I want the data to go in the document and then
cycle through the information and place it in those exact spots.  I know this
sounds complicated and it is but I just want to know basically how to put my
cursor at a specific spot in a document so I can dump the data from the excel
spreadsheet there.
TIA
Heather
Greg - 23 Feb 2005 02:19 GMT
How about using a bookmark?

Something like:
Sub ScratchMacro()
ActiveDocument.Bookmarks("GoHere").Select
End Sub
Jonathan West - 23 Feb 2005 09:45 GMT
> How about using a bookmark?
>
> Something like:
> Sub ScratchMacro()
> ActiveDocument.Bookmarks("GoHere").Select
> End Sub

A bookmark is very probably the right way to go, but thwere's no need to
select it, the text can be inserted directly

ActiveDocument.Bookmarks("GoHere").Range.Text = "My new text"

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Greg - 23 Feb 2005 22:00 GMT
Jonathan,

Copy all.  Thanks.
HeatherO - 26 Feb 2005 19:05 GMT
Thanks I am using bookmarks,  However I do also have to put data into a table
and was just wondering how word recognizes where to put the data in a table
or do I have to put book marks in there but I am just concerned because I am
unsure if there might be 1 line in the table or 4 or more and so I was also
just wondering how you add new rows to a table in word and how to put the
data  into the specific columns of that table.  Thanks again.
Heather

> > How about using a bookmark?
> >
[quoted text clipped - 7 lines]
>
> ActiveDocument.Bookmarks("GoHere").Range.Text = "My new text"
Greg - 23 Feb 2005 02:20 GMT
How about using a bookmark?

Something like:
Sub ScratchMacro()
ActiveDocument.Bookmarks("GoHere").Select
End Sub
HeatherO - 27 Feb 2005 23:17 GMT
So once I get the bookmark how can I take data from an open excel spreadsheet
and insert it at the bookmark on the word document?  
TIA
Heather

> How about using a bookmark?
>
> Something like:
> Sub ScratchMacro()
> ActiveDocument.Bookmarks("GoHere").Select
> End Sub
Greg - 23 Feb 2005 02:20 GMT
How about using a bookmark?

Something like:
Sub ScratchMacro()
ActiveDocument.Bookmarks("GoHere").Select
End Sub

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.