auto copy data

C

Corkey

I tried this before with no success based on the system limitations at work
so I am hoping to try another avenue and hope that someone can help me make
this happen. Here is the scenario:

We use a thin client and run an SAP program and need to leave comments which
we copy and paste from a Word document with predefined numbered exceptions. I
have added book marks and hyperlinks on the word document so all one has to
do is click on the number and it brings them to the corresponding wording
that they then copy to the clipboard and then paste into the comment screen
on SAP. What I would like to do is simplify this one step further and set up
something through Microsoft Word that will automatically copy the wording
once the corresponding number is chosen. I want to eliminate the need for
them to have to highlight and copy the data to the clipboard. Not sure if it
is possible but I know that if it is, this is the place that can help me.

For example – I need to put a comment in the system that Vendor Maintenance
is required.
On my word document, I would click on the hyperlink for #9 VENDOR MASTER
MAINTENANCE
This would bring me to the wording for the comment:

Unable to post invoice:
Remit to on invoice does not match PO remit to.
Please handle exception(s).
Thank you.
Xxxxxxxxxxx (Signature)
XXXXXXXXXX (Department)

I would then highlight the text and copy it to the clipboard and then switch
back to SAP and paste it in the comment screen.

This is the step I want to automate. I would like to have them just click on
the #9 and have the Unable to match… automatically copy to the clipboard so
they can paste it in SAP..

I truly hope this makes sense and I apologize for the length of this but I
wanted to make sure I provided all the details in hopes that someone can help.
 
P

Pesach Shelnitz

A bookmark can be created at a point in a document, or it can embrace a
portion of the document (in your case, that would be a piece of text). If
each of your bookmarks embraces the text that you want to copy to the
clipboard, this can be done. If you select a hyperlink to a bookmark (or even
place the cursor within a hyperlink) and then run the following macro, it
will follow the link and copy the text in the corresponding bookmark to the
clipboard.

Sub CopyBookmarkText()

Dim optionSelected As String

If Selection.Hyperlinks.Count >= 1 Then
optionSelected = Selection.Hyperlinks(1).Name
If ActiveDocument.Bookmarks.Exists(optionSelected) = True Then
ActiveDocument.Bookmarks(optionSelected).Select
Selection.Copy
Selection.Collapse
Else
MsgBox "No bookmark is available for the option selected."
End If
Else
MsgBox "The cursor is not at a hyperlink."
End If
End Sub
 
C

Corkey

I’m sorry, I do not completely understand your response. Are you saying that
I should select the text and then assign it a bookmark. Then how would I run
an macro once the hyperlink is pressed. Is this something that will happen
automatically or is there another step? Sorry for the confusion but I tried
to select the text and then when I tried to book mark it, it would not allow
me to save the name. Maybe I am doing something wrong. Thanks again for your
help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top