Programming

Programming questions? Ask a programmer for answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

I am working with Word 2010 for Windows. I am trying to

Customer Question
I am working with...

I am working with Word 2010 for Windows.

Technician's Assistant: What programs and versions are you using?

I am trying to write a VB script that will take the contents of the clipboard (text) and search the document to see if that string is found any place else.

Technician's Assistant: What is your ideal outcome? How can we solve this for you?

I can't seem to figure out how to access the clipboard in VB for Word! I want a simple macro that does the following:

Technician's Assistant: Anything else you want the programmer to know before I connect you?

Select the previous word, and then check the document to see if the word appears in it previously That should be so easy, but VB for Word simply doesn't want to let me access clipboard! And every search link I find tells me to do something that when I past it into the macro gives me a runtime error!

Submitted: 10 months ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Answered in 4 minutes by:
9/25/2017
Programmer: Dustin, Computer Support Specialist replied 10 months ago
Dustin
Dustin, Computer Support Specialist
Category: Programming
Satisfied Customers: 14,270
Experience: I speak PC fluently, so you dont have to! Worked in The US Army as A Network Switching Systems Operator/Controller
Verified

Welcome to Justanswer.com, my name is Dustin.
I'm sorry to hear about the issue you are having, I will do my best to help you resolve it.

Ask Your Own Programming Question
Programmer: Dustin, Computer Support Specialist replied 10 months ago

The page below outlines several different search strings that can get you to where you want to be

https://word.tips.net/T001833_Generating_a_Count_of_Word_Occurrences.html

Now this page discusses the word problem, Word VBA doesnt exactly have a clipboard, but there are some workarounds. This page should help

https://wordmvp.com/FAQs/MacrosVBA/ManipulateClipboard.htm

If you have any further questions or concerns let me know.

Please remember to click and submit a 5 star rating to show I was able to assist you, without a 5 star rating submitted I am unpaid and unaccredited for my time and expertise.

Thank you,
Dustin S. Sr. Technician and Former Network Switching Systems Operator . Maintainer 31F1P

Ask Your Own Programming Question
Customer reply replied 10 months ago
In what time frame?
Do you understand what I am trying to do?
I have a Word document with some text codes which I type in, and I want to avoid making duplicate entries.
So I want to make a macro that when I type in something like JMa8, it searches the document and finds the prior occurrence of that text, otherwise just stays where I am and lets me continue with the entry.
Programmer: Dustin, Computer Support Specialist replied 10 months ago

It doesnt appear that you read my last reply. Can you read over it, and then get back to me.

D.S

Ask Your Own Programming Question
Customer reply replied 10 months ago
The first link doesn't work for me, because I can't tell the macro what the string is that I'm looking for!
I just typed JMa8614, and I don't want to have to type open the search box and type in JMa8614 again to see if it's in the document once or twice!
And the other link you gave me: https://wordmvp.com/FAQs/MacrosVBA/ManipulateClipboard.htm
Doesn't work either! I already found that by googling, and when I copied and pasted that code into the VBA editor, and then ran the macro, I got a runtime error that says "Dim MyData As DataObject" is a bad line because "DataObject is not a supported type."
So what do I do now? I still can't make this work!
Customer reply replied 10 months ago
DUSTIN, ARE YOU THERE?!
Customer reply replied 10 months ago
I am happy to give you a 5-star rating if you help me solve my problem, but you haven't done that yet.
I need to be able to select some text string, then check the rest of my document to see if it's already been typed in, and I need to be able to do that without re-typing the damn string! I know I can open a Find/Replace dialog box and see if it's there! I don't need to pay to know that! But I want to make a macro that will do this, and I can't get the string I just selected into the "Find what" line of the search dialog box!
Programmer: Dustin, Computer Support Specialist replied 10 months ago

Let me opt so that another expert whos on the clock can assist you.

You will be notified by email when they respond.

Ask Your Own Programming Question
Customer reply replied 10 months ago
I'm giving you a few more minutes, then I'm clicking on "Not happy with your answer? Request another expert."
Programmer: AnswersByEric, Computer Support Specialist replied 10 months ago
AnswersByEric
AnswersByEric, Computer Support Specialist
Category: Programming
Satisfied Customers: 5,208
Experience: Over 10 yrs of electronics support and software development.
Verified

Good evening. I am sorry you do not have an answer yet. I have a question for you. When you select the word/words that you want to see if it is already in the document, why are you not just pressing Ctrl+F and finding all the places it exists in the document? The VB script you're describing is essentially "Find", which is built into all Word versions...

Ask Your Own Programming Question
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a programmerLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask AnswersByEric Your Own Question
AnswersByEric
AnswersByEric
AnswersByEric, Computer Support Specialist
Category: Programming
Satisfied Customers: 5,208
5,208 Satisfied Customers
Experience: Over 10 yrs of electronics support and software development.

AnswersByEric is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,175 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

848 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
I want to get the contents of the clipboard. If I paste it
I want to get the contents of the clipboard. If I paste it straight into excel or word shows it as a tables, but when I use clipboard.gettext none of the table info is retrieved. How can I retrieve th… read more
Kris R
Kris R
IT Manager
Computing
3,312 satisfied customers
Ingo U, how are you? I would like you to make me a
Hello Ingo U, how are you? I would like you to make me a simple Random Access program to write simple data such name, address, state, zip. And I would like a similar Random Access program to read the … read more
Chris Baxter
Chris Baxter
28 satisfied customers
Can I use applescript to remove/replace text in a webform?
Can I use applescript to remove/replace text in a webform? It's easy to google how to fill out a webform with applescript+excel, but I also need to delete or replace text in some fields. I can see whe… read more
Russell H.
Russell H.
Computer Technology Consultant
Vocational, Technical or Trade Scho
791 satisfied customers
I am trying to copy different reference values from Word such
I am trying to copy different reference values from Word such as A456 and paste them in the Excel-Find function box. A456 is associated with column –A & row- 456 in Excel. In this Excel worksheet ther… read more
Ingo U
Ingo U
Master\u0027s Degree
358 satisfied customers
How do I create a macro to clear cells in a column based on
How do I create a macro to clear cells in a column based on data type. If the data is alpha, leave it. If the data is numeric, clear the cell. Thank you very much… read more
Ryan-CTech
Ryan-CTech
Manager
279 satisfied customers
Suryanto -- Theres one more part of this VBS task that I need
Suryanto -- There's one more part of this VBS task that I need your help with. (I didn't want to tie up that last question with any more issues.) The script works fine the first time, but if the user … read more
Suryanto
Suryanto
Computer Engineer
Bachelor's Degree
535 satisfied customers
I currently own Printmaster 2011 Platnium and the one problem
I currently own Printmaster 2011 Platnium and the one problem I have never been able to work around is copying and pasting for instance from word documents copying the content and pasting onto my page… read more
boxfrederick
boxfrederick
Free lance software developer
Bachelor\u0027s Degree
684 satisfied customers
How do I search a sequential text file for a certain product
How do I search a sequential text file for a certain product and display the results. For example, I have a text file that has a store number, state where the store is located, and the managers name. … read more
Steven Caliendo
Steven Caliendo
Vocational, Technical or Trade Scho
99 satisfied customers
I need to copy a segment in a HIPAA ANSI 835 file and insert
I need to copy a segment in a HIPAA ANSI 835 file and insert at a different point in file Find: CLP*FA23434 - 33445* But the CLP*FA is the only constant that I'm looking for and I need to copy only th… read more
Ingo U
Ingo U
Master\u0027s Degree
358 satisfied customers
Im getting a runtime error 438 in a VB script in Excel 2007
I'm getting a runtime error 438 in a VB script in Excel 2007 on the script below, and can't see why. This is an urgent project and I'm stuck. Any help would be greatly appreciated. Private Sub xrefFil… read more
John D
John D
Bachelor Degree in Engineering
342 satisfied customers
Hi, I have been presented with a project that has a fuel machine
Hi, I have been presented with a project that has a fuel machine that produces coal pellets from coal dust using a formula that extracts the water and binds the dust. The machine spits out a text file… read more
Jim Clark
Jim Clark
Web Developer/Database Designer
Bachelor\u0027s Degree
273 satisfied customers
exported text file with unescaped quotes OK, Im at a complete
exported text file with unescaped quotes OK, I'm at a complete loss on this one. I need to export a worksheet/range to a text file, that part I'm sure I can figure out, but the problem is I have to ex… read more
John D
John D
Bachelor Degree in Engineering
342 satisfied customers
I want to write and run a script that will open an email attachment
I want to write and run a script that will open an email attachment (csv), then copy and paste the contents in to an existing excel file. I'm ok with the rules part in excel, just not sure on the scri… read more
John D
John D
Bachelor Degree in Engineering
342 satisfied customers
Ask a Microsoft Word Question I have created an input box
Ask a Microsoft Word Question >I have created an input box within Microsoft word 2003 and would like to increase its size. Alternatively how can I create a new paragraph for the words which are in … read more
SteveG_CaPilot
SteveG_CaPilot
Bachelor\u0027s Degree
9 satisfied customers
Need 2007 access vba programming assistance. Would like to
Need 2007 access vba programming assistance. Would like to obtain a list of the files in a designated directory from the file system. For each record in an Access table, I would like to determine if t… read more
NY Eng
NY Eng
Control Systems Engineer
Bachelor\u0027s Degree
19 satisfied customers
If I use macro in MSWord to seek specific text, is there a
If I use macro in MSWord to seek specific text, is there a way that I can have VB running in the background to recognize a specific text string and launch macro VB radioButton form for (multiple choic… read more
NY Eng
NY Eng
Control Systems Engineer
Bachelor\u0027s Degree
19 satisfied customers
Happy New Year! I am an avid Word 2003 user for Medical Transcription,
Happy New Year! I am an avid Word 2003 user for Medical Transcription, typing 10 hour days. I made a Word macro that copies a patient's name off that document for use in an Excel log sheet. I have to … read more
John The Geek
John The Geek
Senior Software Developer
Bachelor\u0027s Degree
65 satisfied customers
PLEASE!!!!!!!!Any VB expert. What are the chances of
PLEASE!!!!!!!!Any VB expert. What are the chances of getting a sample VB code to do the following 5 steps. 1) move the mouse cursor into a readonly multilinetextbox. 2) Scroll to the top of that textb… read more
Techie_Ben
Techie_Ben
Software Engineer
Master\u0027s Degree
1,444 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x