#31
|
|||
|
|||
Hi Paul,
I have worked out the reason. Its just that when word opens a document downloaded from internet - it opens in non editing mode and we have to click "Enable Content" and hence the reasdon it cannot recognise the document is open and cannot run the macro (at open macro). Regards |
#32
|
|||
|
|||
Another issue
Hi Paul,
Sorry to ask this again, I am just trying to make it work. Now it is giving the error "Style not found". I thought something should be wrong with the style name, however when I clicked on the Debug, the error was on some other line. See the attached image and code is below Code:
Sub Document_Open() Dim StrSty As String, i As Long StrSty = "Custom Breakout,Custom Breakout Subheading,Custom Page Heading," & _ "Custom Page Subheading 1.0,Table Grid, Umesh Table" With ActiveDocument With .Content.find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Text = "monitor" .Replacement.Text = "review" .Execute Replace:=wdReplaceAll .Text = "folder or on a seperate disc" .Replacement.Text = "folder" .Execute Replace:=wdReplaceAll End With If InStr(.Sections.First.Footers(wdHeaderFooterFirstPage).Range.Text, "Statement of Advice") > 0 Then For i = 0 To UBound(Split(StrSty, ",")) Application.OrganizerCopy Source:=.AttachedTemplate.FullName, Destination:=.FullName, _ Name:=Split(StrSty, ",")(i), Object:=wdOrganizerObjectStyles Next End If End With End Sub |
#33
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#34
|
|||
|
|||
Hi Paul,
It seems to be working now. I am going to reinstall word. |
#35
|
||||
|
||||
In all likelihood, it's because the template the code looks at isn't your's anymore, but the user's.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#36
|
||||
|
||||
I can't see that resolving anything. If there is a Word error (unlikely from anything you've described), reinstalling is unlikely to fix it any better than a repair would.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#37
|
|||
|
|||
oh Ok.
I will do repair. |
#38
|
|||
|
|||
Macro not working
Hi,
I have done all the repair etc. I have changed the settings of protected mode. See attached images - I have numbered them in sequence 1,2,34. Please advice what else could be done - for macro to work at start. Regards Last edited by ubns; 08-29-2012 at 05:15 PM. Reason: Forgot Attachment |
#39
|
||||
|
||||
Hi Umesh,
As I said before, a Word error was unlikely from anything you've described. So I don't know why you've done a repair or changed various settings. The first issue to address is why Word detects a problem in the 'reportout' document. For example, is it a valid Word file, or has someone just opened it in Word without checking?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#40
|
|||
|
|||
Ok thanks, so how do you suggest I address that issue.
|
#41
|
||||
|
||||
Well, you could start with the checks I suggested. After all, I have no idea what your 'reportout' document is. The image you posted doesn't indicate a doc(x/m) extension - or any other, for that matter - and I don't even know if it's in a format that Word recognizes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#42
|
|||
|
|||
Hi Paul,
Thanks. What checks you are referring to. FYI the document is .doc type. |
#43
|
||||
|
||||
How do you know it's a doc type? Simply adding a 'doc' extension does not make it one. the error message suggests Word does not think it is a valid doc type.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#44
|
|||
|
|||
Quote:
Then how can I determine the file type? Can you please suggest something on that? Regards |
#45
|
||||
|
||||
I suspect it may be just a plain text file, in which case the content will be readily visibly in Notepad.
A genuine Word Doc file, when viewed with a text editor (eg notepad) begins with the character Ð. There are many other conditions but, if the Ð isn't present, whatever else it might be it's not a Doc file.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create and save custom heading style | ubns | Word | 3 | 08-01-2012 09:42 PM |
Modify a numbered heading style | TheQueenBea | Word | 3 | 06-05-2012 12:12 PM |
Changing numbering in a Heading style | TheQueenBea | Word | 1 | 05-31-2012 02:22 PM |
Very frequent heading style, but still not built in Word!!!!! why??? | Jamal NUMAN | Word | 17 | 06-30-2011 05:47 PM |
How to have this Heading – Table of contents style? | Jamal NUMAN | Word | 0 | 01-13-2011 06:02 PM |