Why string comparison doesn't work here?
Public Sub getAbstract()
For i = 1 To ActiveDocument.Paragraphs.count
Set para = ActiveDocument.Paragraphs(i)
If para.Range.Style = "Heading 1" Then
abst = para.Range.Text
MsgBox abst ' Here the code shows "ABSTRACT" on the textbox
If Trim(abst) = "ABSTRACT" Then
MsgBox 1
End If
Exit For
End If
Next
End Sub
When I run this code it doesn't shows "1" on the textbox. I don't know why
Can someone help me with that?
para.Range.Text includes the paragraph mark at the end of the paragraph. After the line
abst = para.Range.Text
insert
abst = Left(abst, Len(abst) - 1)
to chop off the paragraph mark.
Regards, Hans Vogelaar (http://www.eileenslounge.com)
Similar Messages
-
Why the comparison doesn't work?!
my code is:
<text>
<boundAttribute name="text">
<if>
<comparison type="greaterThanOrEquals">
<fixed javaType="int" text="10"/>
<fixed javaType="int" text="8"/>
</comparison>
<fixed javaType="string" >aaaa</fixed>
<fixed javaType="string">bbbb</fixed>
</if>
</boundAttribute>
</text>whenever the comparison type is "greaterThan" or "lessThan" ,the result always is bbbb.
i use jdev10g.
thanks.thanks for your answer.it does work well.
however,i want to compare a value of pageProp and a value of bc4j:attrValue,like following:
<text>
<boundAttribute name = "text">
<if>
<comparison type="greaterThanOrEquals">
<dataObject select="SetPayDate" source="${uix.pageProp}"/>
<bc4j:attrValue name=DateDue"/>
</comparison>
<fixed javaType="string"> aaa </fixed>
<fixed javaType="string"> bbb </fixed>
</if>
</boundAttribute>
</text>
i have ever seen that it worked well. The second day,it didn't work. :(.
thanks.best regards. -
How to use documentbeforesaved method? And why my code doesn't work in template files?
Can someone help me with these two codes?
----Beginning of code 1-------------
Private WithEvents App As Word.Application
Private Sub Document_Open()
Set App = Word.Application
End Sub
Private Sub App_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)
MsgBox("BeforeSave")
End Sub
--------------End of the code----------------
Beginning of code 2--------------- Code 2 is from https://msdn.microsoft.com/en-us/library/office/ff838299(v=office.15).aspx
Public WithEvents appWord as Word.Application
Private Sub appWord_DocumentBeforeSave _
(ByVal Doc As Document, _
SaveAsUI As Boolean, _
Cancel As Boolean)
Dim intResponse As Integer
Private Sub App_DocumentBeforeSave(ByVal Doc As Document, SaveAsUI As Boolean, Cancel As Boolean)
MsgBox("BeforeSave")
End Sub
In the first code, they have:
Private Sub Document_Open()
Set App = Word.Application
End Sub
I test these two codes in "This document" object, and I find out the first code works but the second code are not!
Why second code doesn't work?
Extra question: I am using microsoft 2013. I insert this code into a macro-enabled template. But when I am about to save my file I am expecting these code works. However, they didn't work!
Thank you for solving these problem for me!Hello,
Please note that the code snippet 2 in your post is different from the code snippet in the MSDN document. Also please read the comments of the MSDN code sample:
This example prompts the user for a yes or no response before saving any document.
This code must be placed in a class module, and an instance of the class must be correctly initialized to see this example work; see
Using Events with the Application Object for directions on how to accomplish this.
Public WithEvents appWord as Word.Application
Private Sub appWord_DocumentBeforeSave _
(ByVal Doc As Document, _
SaveAsUI As Boolean, _
Cancel As Boolean)
Dim intResponse As Integer
intResponse = MsgBox("Do you really want to " _
& "save the document?", _
vbYesNo)
If intResponse = vbNo Then Cancel = True
End Sub
So the problem in your code snippet 2 is that you didn't put it into a class module and initialize the class module. If you just put it into ThisDocument, you have to initialize the word application object.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Why the preloader doesn't work in IE 8 but works in FireFox?
Why the preloader doesn't work in IE 8 but works in FireFox?
Please see the attached files. Thanks in advance.Why doesn't the preloader work in IE8?
What's "virtual sandbox"? -
hi , please tell me why my ipod doesn't work ... when i conect it to my pc nothing happen .. and i can turn on my ipod .. why ? please help me
Go to
http://bt.custhelp.com/app/answers/detail/a_id/47531
and follow the instructions
This was put up by BT several months ago as part of the advance notification that the Yahoo service through them was closing -
Why the imsg doesn't work without a sim card with iOS 7???
Why the imsg doesn't work without a sim card with iOS 7???
If it worked for you using iOS 6, then it appears iOS 7 has made some changes. Was it working before?
-
I've a ipod nano general 7, I've just used it one year. Now, I can't charge the battery. When charging, the icon shows full power. But when I disconnect, the ipod becomes dark, no power is keeped. Why, the battery doesn't work ? the life of my ipod's battery is too short ?
Howdy tamsg,
Welcome to Apple Support Communities.
The article linked below provides a lot of great troubleshooting tips that can help you resolve the issue with your iPod nano charging or displaying a blank black screen.
iPod nano (7th generation): Hardware troubleshooting - Apple Support
So long,
-Jason -
Why this statement doesn't work?
I have two table job and job_status,I use Page Process try to insert records to job_status, but the select query doesn't work, it display all the job in job table didn't filtered out the job matching the query, do someone know why? Any suggestion will be appreciated!
DECLARE
BEGIN
FOR x IN (
SELECT
JOB_SEQ,
PRIMARY
FROM JOB
WHERE ((RUN_DATES like '%'||:P6_WDAY||'%')
or (RUN_DATES like '%'||:P6_DD ||'%')
or (RUN_DATES like ''|| 0 ||'')))
LOOP
INSERT INTO JOB_STATUS(JOB_SEQ, OPERATOR,RUN_DATE) VALUES
(x.JOB_SEQ,x.PRIMARY,to_date(:P6_DATE,'YYYYMMDD'));
END LOOP;
END;ops wrong typed
try
DECLARE
BEGIN
FOR x IN (
SELECT
JOB_SEQ,
PRIMARY
FROM JOB WHERE
((RUN_DATES like CHR(39)||'%'||:P6_WDAY||'%'||CHR(39))
or (RUN_DATES like CHR(39)||'%'||:P6_DD ||'%'||CHR(39))
or (RUN_DATES like ''|| 0 ||'')))
LOOP
INSERT INTO JOB_STATUS(JOB_SEQ, OPERATOR,RUN_DATE) VALUES
(x.JOB_SEQ,x.PRIMARY,to_date(:P6_DATE,'YYYYMMDD'));
END LOOP;
END; -
Why this example doesn't work ?
for example below:
html code:
<applet code=LunarPhasesRB.class width="200" height="200">
</applet>when i run it on IE , i get below result:
failed to loading java program.
why it doesn't work on IE ?
who can help me ?
thanks !thanks a lot!
left of web browser appear below info:
small application program LunarPhasesRB notinited
what does it mean ?
if i click "Click to activate and use this control".
another err:
failed to loading java program.
who can help me ? -
Why FileUtils::CopyFile doesn't work with blank space?
Hi all,
If I have a destination directory with blank space inside, looks like: "C:\Users\Pattrick James\Documents" for Windows or "Macintosh HD:Users:Pattrick James:Documents" for Mac.
Then I want to copy a file to that directory, use FileUtils::CopyFile(src, des). Why it doesn't work?
Can someone please help me to resolve this issue without change my path?Sorry, it works fine. It happens because the permission of the directory.
-
Why Detect Displays doesn't work anymore?
I use my PB to watch movies using my TV and the S-Video to RCA cable, but since the last upgrade 10.4.6 the Detect Displays option (in display menu bar AND preference pane) doesn't work.
The TV shows a dimmed image of what's suppose to show and sometimes it appears vertically distorted.
I disconnected the S-Video cable and restarted the PB but it still shows that "something" is connected to the s-video port.
Which files should I delete to "reset" video preferences?
UPDATE: PRAM reset didn't work...
Thanks in advanceWell, the cable can't be the problem, because the computer is "stuck" with a two monitor configuration, even without the cable plugged in, that's why im guessing there's some kind of switch (i hope) that i can reset so the mother board stops thinking i have another display plugged.... the second problem is that if i plug the s-video to rca cable (that came with the laptop) i can't get a clear tv signal from it... it's distorted.... i'll probably open up the computer and check the s-video port... wish me luck.
-
Why the style doesn't work?
It's my very second test using Flex.
quote:
<mx:Application ...>
<mx:Style>
Text{
backgroundColor:#FFFFFF;
</mx:Style>
<mx:HBox>
<mx:Text />
</mx:HBox> ...
</mx:Application>
This code doesn't work. I'd like to set my text control's
background to white. Why is it wrong?
Thanks.Because mx:Text does not have a backgroundColor
style/property.
Tracy -
sound doesn't work (only in firefox). adobe flash player doesn't work correctly, thought it's installed. can't solve the problem. i need Sound.
== This happened ==
Every time Firefox opened
== don't knowWhat does the Adobe test page say?
http://www.adobe.com/software/flash/about/
Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
You can use "Disable all add-ons" on the ''Safe mode'' start window.
You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")
See also [[No sound in Firefox]] and [[Video or audio does not play]] -
Why my genius doesn't work ?
Hi
I want to share my music library to my phone and i created a genius.When i choose a music it said you have to update.I did but steel doesn't work.
Could you help me about it?Unfortunately, that did not work for me. I just got an iPod touch and while the Genius feature works in iTunes, it is not available on the iPod, even after several syncs and Genius updates. The sync process itself also takes forever even when nothing changed on either the iPod or the computer. Very frustrating. Another odd thing is that iTunes syncs Podcasts to the device that have not been selected in the device setup page ...
-
Why markupDocumentViewer.fullZoom doesn't work on Fennec 4
Hi,
I tried to use gBrowser.selectedBrowser.markupDocumentViewer.fullZoom to do page zoom on Fennec 4 accroding https://developer.mozilla.org/en/Full_page_zoom., but it doesn't work. Could you help me solve this problem or put some sample code?
Thanks,
newmoreThe "gBrowser" (tabbrowser) object does not exist in Fennec. Also, you cannot access the markupDocumentViewer object from the parent process in Fennec; you will need to use a "frame script" running in the content process.
For many more details, see: https://wiki.mozilla.org/Mobile/Fennec/Extensions
For some example code that uses markupDocumentViewer in a Fennec add-on, see:
http://hg.mozilla.org/users/mbrubeck_mozilla.com/biggertext/file/tip
And if you have any questions, you can try the #mobile channel on [http://irc.mozilla.org irc.mozilla.org]. (If you don't get a response, be patient - most people on this channel are only around during North America business hours.)
Maybe you are looking for
-
Messed up Windows 8.1 install after using Boot Camp 4 drivers
Hey guys, I just finished successfully installing Windows 8.1 on my Mac with Lion. There were no issues there, but I royally screwed up the Windows partition after trying to install the Boot Camp support software from a USB flash drive. I didn't look
-
Exception in thread "main" trouble
I'm using NetBeans IDE 3.5.1 and every single program I've tried to write always comes out with, "java.lang.NoClassDefFoundError: (file name) Exception in thread "main" when I try to execute it. Here's a sample program; // Tests to see whether a floa
-
Is there any way to access a single iTunes library on multiple computers simultaneously?
Hi, I'm looking to set up a system whereby my music would be stored on a single computer kept on 24/7. There would be approximately 7 client computers that would access this master computer to play music from. However, the tricky part is that it woul
-
Your Experience with RSSM / compatibility mode in BW 3.X ?
Hi Folks, we have a dozen of InfoObjects referencing 0costcenter. These Objects are used in several InfoProviders and queries. We also have more than 500 authorizations definitions for hierarchies, at the time being defined on 0costcenter. This all w
-
Read navigation url OR Custom property for a term in Taxonomy using Javascript
Hi All, we have followed the below steps to retrieve the managed metadata terms. http://sympmarc.com/2013/10/11/spservices-stories-18-retrieve-managed-metadata-using-javascript-and-spservices/ and we have achieved and constructed the same through Jav