-
Oct 11th, 2013, 04:56 PM
#1
Thread Starter
New Member
vb6 with Office 2013
I am relatively new to vb and I am trying to modify my company's complex (at least to me) vb applications. The one in particular that I am having troubles with, doesnt work well with Office 2013. I get an error saying the edit replace function is not available. What is happening at the time of the error: The data in the GUI is supposed to be copied into a Word template document.
I think I found the code where this is happening:
If MultipleReplaceFlag Then
.EditReplace Find:=OldString$, Replace:=ReplaceString$, Wrap:=1, ReplaceAll:=True
Else
.EditReplace Find:=OldString$, Replace:=ReplaceString$, Wrap:=1, ReplaceOne:=True
End If
What can I do to get this program to work with Office 2013?
**Note**
I have tried updating to .NET but there are a few hundred errors minimum in each program. For me, the "help" given isn't much help so it is very slow going that route.
-
Oct 12th, 2013, 01:05 AM
#2
Re: vb6 with Office 2013
I get an error saying the edit replace function is not available.
as your code does not show which object is trying to editreplace, i would assume it should be a range object of some sort, but hard to tell from the snippet supplied
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 12th, 2013, 01:16 AM
#3
-
Oct 12th, 2013, 03:50 AM
#4
Frenzied Member
Re: vb6 with Office 2013
please always write the code inside the Code tags.together with this please post the full code of the method .where you are playing with it
Code:
If MultipleReplaceFlag Then
.EditReplace Find:=OldString$, Replace:=ReplaceString$, Wrap:=1, ReplaceAll:=True
Else
.EditReplace Find:=OldString$, Replace:=ReplaceString$, Wrap:=1, ReplaceOne:=True
End If
-
Oct 21st, 2013, 08:55 AM
#5
Thread Starter
New Member
Re: vb6 with Office 2013
I apologize for the late response on my part. The programs were all written and compiled in VB6, and that is as much as I know. I don't know how I would tell if it is VBA or VB6.
I am not sure how to put in code tags. I have inserted a link to a text document containing the code. This is not all the code attached to the form but it is (I believe) the only place the edit replace is performed. The application integrates with a multivalue database and the code attached is where it copies everything into the template.
https://dl.dropboxusercontent.com/u/62987665/vb.txt
-
Oct 21st, 2013, 03:35 PM
#6
Re: vb6 with Office 2013
I don't know how I would tell if it is VBA or VB6.
vba (visual basic for applications) is not compiled, it is an interface within some application, generally an office product, VB6 is a programming language, that will create compiled executables, office applications can be automated by vb6 executables
[code] your code here [/code (requires closing bracket) will give a code box, seems hard to give an example without just making a code box, though i have seen it done
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Oct 22nd, 2013, 07:14 AM
#7
Re: vb6 with Office 2013
> I get an error saying the edit replace function is not available.
>...the code that you gave looks like VBA
EditReplace is a not a valid call in Word VBA and I suggest the macro may be written in WordBasic (which did include EditReplace). Word's VBA can however still apparently support WordBasic calls/ code via its WordBasic object; deets for that here http://msdn.microsoft.com/en-us/libr.../ff822917.aspx
I fear you will find it hard to find much documentation on WordBasic or help in debugging the code; you could be lucky though...
It may be good to see some more of your code so we can see the object to which .EditReplace belongs.
-
Nov 7th, 2013, 12:48 PM
#8
Thread Starter
New Member
Re: vb6 with Office 2013
Sorry for the long delay. It seems that you are correct Magic Ink. It looks like the object .EditReplace belongs to is MSWord. It was declared as an object at the very top of the code (not shown in my link).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|