Disappearing text when doing a paste

MS WORD

    Next

  • 1. Creating a word doc from a webpage.
    Hi Please help.. What I want to do is to create a web form that once submitted it takes the fields and opens a new instance of a Word Template and populates bookmarks within the document with the fields from the web form, then saves it to a specified location with a specified name... does anyone know of an article or tutorial about this.... cheers nuve
  • 2. Formatting for merge fields
    Is there anyway to format specific merge fields so that they can have dashes, decimal points or dollar signs in appropriate places? I have a user that merges a bunch of informtion into several merge fields and I want only certain fields to have dashes, certain fields to have dollar signs and decimal points and so on. TIA, Jason
  • 3. DAO or ADO in Windows 2000, which to choose?
    Hi guys, I noticed when I tried to create a Database object in VBA, that VB had no idea what i was talking about. I figured it would be another reference issue but i couldnt think why such a default library would be missing. So I discovered that ADO, which doesnt have a database object, is referenced by default and you have to explicitly reference DAO 3.6 to get access to the required objects. I have two questions. How come ADO is used now instead of DAO and should I be using ADO instead? Also, in as few words as possible (i'm not expecting a whole article on it :-), how do you access database tables using ADO. Does anyone have a decent resource that describes ADO in terms of VBA explicitly? Thanks everyone Kindest Regards Simon
  • 4. =rand(x,y) usable in VBA-code ? How ??
    Hello all, For some testing during program development I want to (programmatically) create a new document and add some or very much (!!) text to it. So I tried to use the (undocumented) =rand(x,y) function in my VBA-program. What I first did: Sub Test() Documents.Add With ActiveDocument Selection.TypeText Text:="=rand(3,5)" End With End Sub What happened when running this macro? 1. New document created (fine thus far) 2. With text "=rand(3,5)" in it, in stead of 3 paragraphs with 5 times "The quick....", so not good. However I can understand that it just adds the string 3. Thus macro was finished and pressing the <enter>-key once changed to document to the required result: but I dont want any interactive interaction!! So I tried the following: Sub Test() Documents.Add With ActiveDocument Selection.TypeText Text:="=rand(3,5)" Selection.TypeParagraph End With End Sub Same result: text =rand(3,5) in the document and same behaviour: pressing <enter> changes it. So another try: Sub Test() Documents.Add With ActiveDocument Selection.TypeText Text:="=rand(3,5)" Call SendKeys("%{ENTER}") End With End Sub This should do !! But no: now I enter with a document with the following line: =rand(3,5)=rand(3,5) (???...) So my question is: how can I use the =rand(x,y) in a macro? Regards, Hans Troost

Disappearing text when doing a paste

Postby amFn » Tue, 22 Feb 2005 08:29:11 GMT

Hello all,

Having a problem coping data from one document to another.  I need to 
automate the following task.  I have a document that my customer opens and 
clicks a button that does a copy.  When the  button is clicked, I need the 
following to happen.

The file open dialog box displays so they can pick the file that has data to 
be copied from
The selected file is opened
Data from an enclosed bookmark in the newly opened file is copied
The data is then pasted to a bookmark location in the intial document

I have this working, the problem  is when I do the past into the  initial 
document, it deletes all the text in the document and then paste the new 
text.  
What am I doing wrong??  I needed to be sure the copied data retains all 
formatting, like bullet list, etc.  My code is listed below.

thanks


Sub Copy_Description()
    Dim DescriptionDoc As Document
    Dim pTarget As Range
    
    Dialogs(wdDialogFileOpen).Show
    Set DescriptionDoc = ActiveDocument
  
    Set pTarget =    
ActiveDocument.Bookmarks("BM_TheDescription").Range.FormattedText
    pTarget.Copy
    
    If ThisDocument.Bookmarks.Exists("BM_Description") Then
        ThisDocument.Bookmarks("BM_Description").Select
        ThisDocument.Range.Paste
    End If
    
    ActiveDocument.Close
        
End Sub


Re: Disappearing text when doing a paste

Postby Word Heretic » Tue, 22 Feb 2005 16:39:55 GMT

G'day jag < XXXX@XXXXX.COM >,

<Grin>

    If ThisDocument.Bookmarks.Exists("BM_Description") Then
        ThisDocument.Bookmarks("BM_Description").Select

'____________________

        ThisDocument.Range.Paste
' _____________________

    End If



Look at that line. It is pasting OVER the entire Range of
ThisDocument!

Replace it with 

Selection.Paste


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


jag reckoned:



Re: Disappearing text when doing a paste

Postby G.G.Yagoda » Wed, 23 Feb 2005 00:36:04 GMT

Why not use the bookmark ranges instead of copying and pasting?

Sub CopyUsingRanges ()
Dim TargetDoc As Document
Set TargetDoc = ActiveDocument
Dialogs(wdDialogFileOpen).Show
If ActiveDocument.Bookmarks.Exists("BM_Description") And
TargetDoc.Bookmarks.Exists("BM_Description") Then
    TargetDoc.Bookmarks("BM_Description").Range.FormattedText =
ActiveDocument.Bookmarks("BM_Description").Range
    ActiveDocument.Close
End If
End Sub


Re: Disappearing text when doing a paste

Postby amFn » Wed, 23 Feb 2005 04:33:02 GMT

Thanks, this works.
However there is one problem, it retains the bullet list (if there is one) 
but the text comes over as a different font.  In this case courier, the 
original text was Times New Roman.. Any suggetions??

Thanks





Re: Disappearing text when doing a paste

Postby G.G.Yagoda » Wed, 23 Feb 2005 07:13:48 GMT

It's interesting that the original font is carried over in bulleted
paragraphs.  Assuming that the style for the bulleted paragraphs has
the word "Bullet" in it and that the font you want is Times New Roman,
this should provide the cure:

Dim TargetDoc As Document, R As Range, P As Paragraph
Set TargetDoc = ActiveDocument
Dialogs(wdDialogFileOpen).Show
If ActiveDocument.Bookmarks.Exists("BM_Description") And
TargetDoc.Bookmarks.Exists("BM_Description") Then
    TargetDoc.Bookmarks("BM_Description").Range.FormattedText =
ActiveDocument.Bookmarks("BM_Description").Range
    ActiveDocument.Close
    For Each P In
TargetDoc.Bookmarks("BM_Description").Range.Paragraphs
        If InStr(P.Style.NameLocal, "Bullet") > 0 Then
P.Range.Font.Name = "Times New Roman"
    Next
End If


Re: Disappearing text when doing a paste

Postby amFn » Wed, 23 Feb 2005 07:49:01 GMT

The original font is not carried over at all, I was just saying the
bullets do carrie over.  
Can I just select the text then change the font???

thanks





Re: Disappearing text when doing a paste

Postby G.G.Yagoda » Wed, 23 Feb 2005 14:31:42 GMT

Because the bulleted list is part of a larger range, I don't see how
you could select it to operate on except by hand.  Maybe if you changed
the For Each paragraph loop you could achieve what you want.  For
example, to change the bullet-styled paragraphs to Normal:

    For Each P In
TargetDoc.Bookmarks("BM_Description").Range.Paragraphs
        If InStr(P.Style.NameLocal, "Bullet") > 0 Then
P.Style = "Normal"
    Next 

Sorry, I did not understand about the fonts.


Similar Threads:

1.pasted HTML text disappears


Thanks Jean_Guy

That was the first thing I thought too, but the font is black on a white 
background.
To double check, I tried to pasted it into a .doc and it pasted fine.

However, in EXCEL, I have to double click the mouse to get the text to 
appear.  

I just noiticed that when I do that, most of the options, on the standard 
options toolbar, selected from the "View," go gray.
 
Opening "View," on the Menu, when the only choice that isn't gray is 
"toolbars.". 

For the cell that keeps hiding, at the input box at the top of the page, 
where a "=" is entered to indicate the cell contains a formula is active and 
shows, an X, a check mark, and the = sign.

However, for the cells that show text, that area is gray and empty. When I 
select one of those cells, all the options that gray out when the "blank" row 
that contains a header and has to be double clicked to get it to show, return.

So, we are still unsolved on this problem.   Oh, I also checked to see if 
anyting was hidden and it wasn't.  

More help is needed to figure out how to simply paste the headers in a cell, 
without having them disappear unless I double click the cell and keep the 
curson in it.

Thanks, Bob 

"pinmaster" wrote:

> Hi,
> 
> Probably white font on white background........try changing the font color.
> 
> Hope this helps!
> Jean-Guy
> 
> "sunslight" wrote:
> 
> > I copy from a web page, part of a document that has section headers, plain 
> > text, hyperlink text.
> > 
> > I paste it into Excel--just a straight paste with the mouse.  I'm not using 
> > the "Edit | Special" because I want to preserve the hyperlinks.
> > 
> > It all seems to be there, except for the seciton headers.
> > 
> > The rows that they are on are there, but nothing is visible.
> > 
> > However, if I move my mouse into the cell and dbl click, the text appears. 
> > Move it out of the cell and it's gone.
> > 
> > It's a neat trick, but not very useful if I don't know how to control it.
> > 
> > What I want is to have the headers show up, just like the rest of the 
> > document.
> > 
> > (btw) it copies fine into Word.
> > 
> > Ideas?

2.Copied text from Notepad disappears when pasted to Outlook XP

This seems to be a recurring but intermittent problem.

3.Text disappears upon pasting

Ever since we switched to Office 2007, I've had the following problem with 
Outlook:

When pasting into an email -- sometimes a new one, sometimes from Drafts -- 
the text I'm pasting not only doesn't show up, but ALL the text in the 
recipient email disappears. Then there is a long lag -- one to two minutes, 
I'd estimate -- before the copy shows up and the rest of the original copy 
returns. 

This happens when copying from other emails or from websites. (I'm not sure 
about documents.) The COMPLETELY bizarre thing is that sometimes the copy in 
the SOURCE email also disappears and only returns when the pasted copy shows 
up.

As you can imagine, at first I tried clicking frantically around both 
emails, trying to get my copy back (aaarg!), but I couldn't tell if that sped 
things up or not. 

Isn't this weird? It's stumped IT, who are really very good.

Any and all input gratefully received,

-- 
hammar2007

4.pasted text disappears

It seems that whenever I cut and paste text from most any application into 
Outlook, it shows up as invisible.  If I select the new area where the text 
should be and change the color of that text to BLACK, there it is -- 
perfectly visible.  It seems that anything with color set to the default 
AUTOMATIC is invisible.  I've made signatures in Outlook 2007 and they, too, 
are invisible in a new message unless I select them and change the color.

Other people receiving mail from me say it looks fine when they get it, but 
if they try to cut and paste some of my text, it shows up invisible in 
whatever other e-mail message or application they're pasting it.  Wierd!  

I had this problem so often in Outlook Express that I recently switched over 
to Outlook to try and get past it.  However, the problem followed me right 
into Outlook.  There's gotta be a setting somewhere that tells the system 
AUTOMATIC is not black ... maybe white?  (I haven't tested it on a colored 
background to see.)

Can anyone help me with this?  Thanks.

5.Layer disappears when pasting text

When I paste text that I copied from Word into a DW layer it looks great. When 
I save the page and 
 reopen it the layer is gone and the text is reformatted. What's interesting is 
the layer does not show 
 up in the layers pallet but I still see mention of it in the code.
 How do I get the layer to stay?
 Thanks
 Rob

6. Why do zip codes w/ leading zeros disappear when doing mail merge

7. Word document doing a disappearing act

8. pasting text so if the original changes so will the pasted text



Return to MS WORD

 

Who is online

Users browsing this forum: No registered users and 58 guest