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: 7 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 7 months ago
Dustin
Dustin, Computer Support Specialist
Category: Programming
Satisfied Customers: 14,011
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 7 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 7 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 7 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 7 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 7 months ago
DUSTIN, ARE YOU THERE?!
Customer reply replied 7 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 7 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 7 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 7 months ago
AnswersByEric
AnswersByEric, Computer Support Specialist
Category: Programming
Satisfied Customers: 5,160
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?
Ask AnswersByEric Your Own Question
AnswersByEric
AnswersByEric
AnswersByEric, Computer Support Specialist
Category: Programming
Satisfied Customers: 5,160
5,160 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,131 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

800 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
In C program. Write functions that: (a) Print all even
In C program. Write functions that: (a) Print all even numbers between 0 and 40. (b) Print all numbers between 1 and 100, with 10 numbers on each line. Use two for loops. All columns should be aligned… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
I am trying to write a code that generates the the koch
i am trying to write a code that generates the the koch snowflake with n iterations … read more
Chris Baxter
Chris Baxter
28 satisfied customers
I have a server and client assignment based off the last
Hey i have a server and client assignment based off the last assignment i am stucked with processing datacommented lines in gameplayframe is data needed to sent to server when client calls the frameco… read more
LogicPro
LogicPro
Computer Software Engineer
Bachelor of Technology
7,131 satisfied customers
Checkbook I want a formula to subtract column A from column
Checkbook I want a formula to subtract column A from column G and add add column F to column g … read more
Jason Jones
Jason Jones
AAS Information Technology
6,322 satisfied customers
I'm looking for some MVC design help for a PHP bulk webpage
I'm looking for some MVC design help for a PHP bulk webpage test tool I'm building. I can tell you what I've done already, or I can tell you what the program does and we can go from there. … read more
George Sibiya
George Sibiya
PhD
284 satisfied customers
PPT for MAC file now cannot open says corrupted. I'm running
PPT for MAC file now cannot open says corrupted. I'm running Mac 10.13.4 and PPT newest update. Crashed before I did PPT updates. File is 4 gig (I imbed videos) but critical need for Monday. Any ideas… read more
David L.
David L.
Bachelor\u0027s Degree
6 satisfied customers
I have my excel spreadsheet with subscribers name and email
I have my excel spreadsheet with subscribers name and email saved on excel and the A row or column? is all clunched up and I can't read it, the other colums are intruding onto A column if you see what… read more
Jason Jones
Jason Jones
AAS Information Technology
6,322 satisfied customers
I'm using VB 6 and trying to copy an ACCESS database and
I'm using VB 6 and trying to copy an ACCESS database and rename it. I can do that now using DBEngine.compactDatabase but now I'm trying do it with a password ***** database and having no luck. … read more
George Sibiya
George Sibiya
PhD
284 satisfied customers
How do I make variables declared in a macro available to a
How do I make variables declared in a macro available to a calledPersonal.xlsb macro? … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
How can I change the site header and tag line font size?
How can I change the site header and tag line font size? … read more
Pete
Pete
Engineer
Bachelor\u0027s Degree
1,130 satisfied customers
I have a report that gives me customer number, part number,
I have a report that gives me customer number, part number, date sold and other various sales data for a particular month. I am trying to write a formula that will give me the most recent date for a p… read more
George Sibiya
George Sibiya
PhD
284 satisfied customers
VBA Question. I define a function in VBA but an not able to.
VBA Question. I define a function in VBA but an not able to … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
I have Data obtained from a Computer Program that I would
I have Data obtained from a Computer Program that I would like to trend - a valve could be 103 but on the trend graph it gives a Zero. Also each of the block where the number is ***** a little green c… read more
Michael Rademacher
Michael Rademacher
MBA
10 satisfied customers
Software: Run-time error ‘340': Control array element ‘618'
Software:Run-time error ‘340': Control array element ‘618' doesn't existWhat does this mean?Thank you… read more
Michael Rademacher
Michael Rademacher
MBA
10 satisfied customers
You have helped me quite a bit in the past couple of years
You have helped me quite a bit in the past couple of years so I have what I hope is a very easy question for you - you wrote a macro code for me to do a 'Top Ten' list including ties but I now have a … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
I think this is simple...I can't get Excel to draw a pie
I think this is simple...I can't get Excel to draw a pie chart with a particular data set, even though I have had success in the past. … read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 satisfied customers
I password protected a page in Wordpress but can't get pass
I password ***** a page in Wordpress but can't get pass the sign in to view the page. Can you help? … read more
John Holland
John Holland
Bachelor\u0027s Degree
20 satisfied customers
I HAVE a VB program code segments which when I first run it
I HAVE a VB program code segments which when I first run it give an execution error(i.e. like converting string input to number). When I reset and run a second time, the program executes. This happens… read more
The-PC-Guy
The-PC-Guy
Software Engineer
Bachelor's Degree
800 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